summaryrefslogtreecommitdiff
path: root/chromium/third_party/breakpad
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/breakpad
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/breakpad')
-rw-r--r--chromium/third_party/breakpad/BUILD.gn8
-rw-r--r--chromium/third_party/breakpad/breakpad/LICENSE82
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.h46
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.mm300
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.h42
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/crash_generation/crash_generation_server.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/log/log.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.h22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.mm204
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.h12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.mm12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.h22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.mm30
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.cc16
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.h32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.cc77
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.h12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.cc44
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.h26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.h62
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.cc184
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.h70
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/mac/testapp/main.m2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer-inl.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.cc30
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.h42
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer_unittest.cc17
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.h32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler_test.cc14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.cc176
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_test.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.cc72
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.h16
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.cc14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.h18
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/unittests/dump_analysis.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_death_test.cc18
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_test.cc20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/android/testing/pthread_fixes.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/byte_cursor.h49
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/byte_cursor_unittest.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader-inl.h29
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.h33
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.h44
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2enums.h38
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.cc776
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.h179
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc52
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc187
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_test_common.h24
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc150
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.h36
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf/functioninfo.cc17
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.h28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module_unittest.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.cc172
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.h42
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module_unittest.cc194
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.h10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module_unittest.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/language.cc42
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/language.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/breakpad_getcontext.S4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.cc56
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.h10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.cc20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/file_id.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/file_id_unittest.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/guid_creator.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.cc56
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.h24
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/linux_libc_support.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/symbol_upload.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf_unittest.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.h42
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.m39
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.h52
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.m199
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.h51
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.m62
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.h73
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.m213
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.h57
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.m69
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.h20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.mm26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.h102
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.m240
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.cc81
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.h24
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.h41
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.m47
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.cc32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.h28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.cc38
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.h46
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader_unittest.cc86
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.cc20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.h26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/minidump_upload.m (renamed from chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/minidump_upload.m)40
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/mac/super_fat_arch.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/md5.cc14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/memory_allocator.h22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/module.cc56
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/module.h62
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/module_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.cc149
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/solaris/file_id.cc36
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/solaris/guid_creator.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_reader.cc26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_reader.h36
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_reader_unittest.cc36
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/stabs_to_module_unittest.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/string_conversion.cc58
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/string_conversion.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/test_assembler.cc48
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/test_assembler.h70
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/test_assembler_unittest.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/omap.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.cc48
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.h10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/pe_util.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/string_utils-inl.h22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/common/windows/string_utils.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/basic_source_line_resolver.h40
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump.h38
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump_processor.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_base.h40
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_interface.h24
-rw-r--r--chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/symbol_supplier.h28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/address_map-inl.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/address_map.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/address_map_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/basic_code_module.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/basic_code_modules.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver.cc100
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_types.h28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_unittest.cc32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/call_stack.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info-inl.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.cc32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.h52
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info_unittest.cc26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/contained_range_map-inl.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/contained_range_map.h16
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/contained_range_map_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc68
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.h34
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/exploitability_win.cc16
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_types.h30
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_unittest.cc22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/logging.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/logging.h16
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/map_serializers-inl.h54
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/map_serializers.h26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/map_serializers_unittest.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/microdump_stackwalk.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump.cc34
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump_dump.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump_processor.cc72
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump_processor_unittest.cc80
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump_stackwalk.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/minidump_unittest.cc118
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/module_comparer.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/module_comparer.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/module_factory.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/module_serializer.cc28
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/module_serializer.h26
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator-inl.h32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator.h30
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator_unittest.cc24
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/process_state.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/range_map-inl.h22
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/range_map.h30
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/range_map_unittest.cc18
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/simple_serializer-inl.h44
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/simple_serializer.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.cc32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.h40
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base.cc48
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base_types.h20
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalk_common.cc82
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_address_list_unittest.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.cc6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64_unittest.cc46
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64_unittest.cc36
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm_unittest.cc44
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_selftest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_unittest_utils.h64
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86_unittest.cc104
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_address_map-inl.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_address_map.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_address_map_unittest.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map-inl.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_map-inl.h6
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_map.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator-inl.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator.h2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_map_unittest.cc8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_range_map-inl.h18
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_range_map.h14
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/static_range_map_unittest.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.cc54
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.h88
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/tokenize.cc17
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/tokenize.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/processor/windows_frame_info.h8
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/linux/dump_syms/dump_syms.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc12
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/minidump_upload.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/sym_upload.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h44
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm94
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/macho_dump.cc32
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.m235
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj50
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/solaris/dump_syms/dump_syms.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc62
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.h40
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/converter.cc124
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.cc10
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.h4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/winhttp_client.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/wininet_client.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms.cc2
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc4
-rw-r--r--chromium/third_party/breakpad/breakpad/src/tools/windows/symupload/symupload.cc20
302 files changed, 6058 insertions, 4129 deletions
diff --git a/chromium/third_party/breakpad/BUILD.gn b/chromium/third_party/breakpad/BUILD.gn
index 5617de88e47..062cd649bdc 100644
--- a/chromium/third_party/breakpad/BUILD.gn
+++ b/chromium/third_party/breakpad/BUILD.gn
@@ -342,7 +342,13 @@ if (is_mac) {
executable("symupload") {
sources = [
+ "breakpad/src/common/mac/HTTPGetRequest.m",
"breakpad/src/common/mac/HTTPMultipartUpload.m",
+ "breakpad/src/common/mac/HTTPPutRequest.m",
+ "breakpad/src/common/mac/HTTPRequest.m",
+ "breakpad/src/common/mac/HTTPSimplePostRequest.m",
+ "breakpad/src/common/mac/SymbolCollectorClient.m",
+ "breakpad/src/common/mac/encoding_util.m",
"breakpad/src/tools/mac/symupload/symupload.m",
]
@@ -1032,6 +1038,8 @@ if (is_ios) {
"breakpad/src/common/convert_UTF.h",
"breakpad/src/common/long_string_dictionary.cc",
"breakpad/src/common/mac/HTTPMultipartUpload.m",
+ "breakpad/src/common/mac/HTTPRequest.m",
+ "breakpad/src/common/mac/encoding_util.m",
"breakpad/src/common/mac/file_id.cc",
"breakpad/src/common/mac/file_id.h",
"breakpad/src/common/mac/macho_id.cc",
diff --git a/chromium/third_party/breakpad/breakpad/LICENSE b/chromium/third_party/breakpad/breakpad/LICENSE
index 95207bdf6f9..a840b26471e 100644
--- a/chromium/third_party/breakpad/breakpad/LICENSE
+++ b/chromium/third_party/breakpad/breakpad/LICENSE
@@ -48,3 +48,85 @@ supplied in this file in the creation of products supporting the
Unicode Standard, and to make copies of this file in any form
for internal or external distribution as long as this notice
remains attached.
+
+--------------------------------------------------------------------
+
+libunwind - a platform-independent unwind library
+ Copyright (C) 2008 Google, Inc
+ Contributed by Paul Pluzhnikov <ppluzhnikov@google.com>
+ Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org>
+
+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. */
+
+--------------------------------------------------------------------
+
+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@
+
+--------------------------------------------------------------------
+
+Copyright (c) 1989, 1993
+The Regents of the University of California. All rights reserved.
+
+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.
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.h b/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.h
index fa790f7712e..6c9b8bd64ca 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.h
@@ -37,7 +37,7 @@
//
// These files can then be uploaded to a server.
-typedef void *BreakpadRef;
+typedef void* BreakpadRef;
#ifdef __cplusplus
extern "C" {
@@ -60,15 +60,15 @@ extern "C" {
typedef bool (*BreakpadFilterCallback)(int exception_type,
int exception_code,
mach_port_t crashing_thread,
- void *context);
+ 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);
+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
@@ -163,7 +163,7 @@ typedef void (*BreakpadUploadCompletionCallback)(NSString *report_id,
// internal values.
// Returns a new BreakpadRef object on success, NULL otherwise.
-BreakpadRef BreakpadCreate(NSDictionary *parameters);
+BreakpadRef BreakpadCreate(NSDictionary* parameters);
// Uninstall and release the data associated with |ref|.
void BreakpadRelease(BreakpadRef ref);
@@ -187,20 +187,20 @@ void BreakpadRelease(BreakpadRef ref);
// TODO (nealsid): separate server parameter dictionary from the
// dictionary used to configure Breakpad, and document limits for each
// independently.
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value);
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key);
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key);
+void BreakpadSetKeyValue(BreakpadRef ref, NSString* key, NSString* value);
+NSString* BreakpadKeyValue(BreakpadRef ref, NSString* key);
+void BreakpadRemoveKeyValue(BreakpadRef ref, NSString* key);
// You can use this method to specify parameters that will be uploaded
// to the crash server. They will be automatically encoded as
// necessary. Note that as mentioned above there are limits on both
// the number of keys and their length.
-void BreakpadAddUploadParameter(BreakpadRef ref, NSString *key,
- NSString *value);
+void BreakpadAddUploadParameter(BreakpadRef ref, NSString* key,
+ NSString* value);
// This method will remove a previously-added parameter from the
// upload parameter set.
-void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key);
+void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString* key);
// Method to handle uploading data to the server
@@ -208,10 +208,10 @@ void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key);
int BreakpadGetCrashReportCount(BreakpadRef ref);
// Returns the next upload configuration. The report file is deleted.
-NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref);
+NSDictionary* BreakpadGetNextReportConfiguration(BreakpadRef ref);
// Returns the date of the most recent crash report.
-NSDate *BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref);
+NSDate* BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref);
// Upload next report to the server.
void BreakpadUploadNextReport(BreakpadRef ref);
@@ -220,7 +220,7 @@ void BreakpadUploadNextReport(BreakpadRef ref);
// |server_parameters| is additional server parameters to send.
void BreakpadUploadNextReportWithParameters(
BreakpadRef ref,
- NSDictionary *server_parameters,
+ NSDictionary* server_parameters,
BreakpadUploadCompletionCallback callback);
// Upload a report to the server.
@@ -228,8 +228,8 @@ void BreakpadUploadNextReportWithParameters(
// |configuration| is the configuration of the breakpad report to send.
void BreakpadUploadReportWithParametersAndConfiguration(
BreakpadRef ref,
- NSDictionary *server_parameters,
- NSDictionary *configuration,
+ NSDictionary* server_parameters,
+ NSDictionary* configuration,
BreakpadUploadCompletionCallback callback);
// Handles the network response of a breakpad upload. This function is needed if
@@ -239,21 +239,21 @@ void BreakpadUploadReportWithParametersAndConfiguration(
// BreakpadUploadReportWithParametersAndConfiguration.
// |data| and |error| contain the network response.
void BreakpadHandleNetworkResponse(BreakpadRef ref,
- NSDictionary *configuration,
- NSData *data,
- NSError *error);
+ NSDictionary* configuration,
+ NSData* data,
+ NSError* error);
// Upload a file to the server. |data| is the content of the file to sent.
// |server_parameters| is additional server parameters to send.
-void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name,
- NSDictionary *server_parameters);
+void BreakpadUploadData(BreakpadRef ref, NSData* data, NSString* name,
+ NSDictionary* server_parameters);
// Generate a breakpad minidump and configuration file in the dump directory.
// The report will be available for uploading. The paths of the created files
// are returned in the dictionary. |server_parameters| is additional server
// parameters to add in the config file.
-NSDictionary *BreakpadGenerateReport(BreakpadRef ref,
- NSDictionary *server_parameters);
+NSDictionary* BreakpadGenerateReport(BreakpadRef ref,
+ NSDictionary* server_parameters);
#ifdef __cplusplus
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.mm b/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.mm
index 2b61bbe392a..11c5174664d 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/Breakpad.mm
@@ -84,9 +84,9 @@ using google_breakpad::LongStringDictionary;
// allocation of C++ objects. Note that we don't use operator delete()
// but instead call the objects destructor directly: object->~ClassName();
//
-ProtectedMemoryAllocator *gMasterAllocator = NULL;
-ProtectedMemoryAllocator *gKeyValueAllocator = NULL;
-ProtectedMemoryAllocator *gBreakpadAllocator = NULL;
+ProtectedMemoryAllocator* gMasterAllocator = NULL;
+ProtectedMemoryAllocator* gKeyValueAllocator = NULL;
+ProtectedMemoryAllocator* gBreakpadAllocator = NULL;
// Mutex for thread-safe access to the key/value dictionary used by breakpad.
// It's a global instead of an instance variable of Breakpad
@@ -101,8 +101,8 @@ pthread_mutex_t gDictionaryMutex;
// Its destructor will first re-protect the memory then release the lock.
class ProtectedMemoryLocker {
public:
- ProtectedMemoryLocker(pthread_mutex_t *mutex,
- ProtectedMemoryAllocator *allocator)
+ ProtectedMemoryLocker(pthread_mutex_t* mutex,
+ ProtectedMemoryAllocator* allocator)
: mutex_(mutex),
allocator_(allocator) {
// Lock the mutex
@@ -127,17 +127,17 @@ class ProtectedMemoryLocker {
ProtectedMemoryLocker(const ProtectedMemoryLocker&);
ProtectedMemoryLocker& operator=(const ProtectedMemoryLocker&);
- pthread_mutex_t *mutex_;
- ProtectedMemoryAllocator *allocator_;
+ pthread_mutex_t* mutex_;
+ ProtectedMemoryAllocator* allocator_;
};
//=============================================================================
class Breakpad {
public:
// factory method
- static Breakpad *Create(NSDictionary *parameters) {
+ static Breakpad* Create(NSDictionary* parameters) {
// Allocate from our special allocation pool
- Breakpad *breakpad =
+ Breakpad* breakpad =
new (gBreakpadAllocator->Allocate(sizeof(Breakpad)))
Breakpad();
@@ -155,62 +155,62 @@ class Breakpad {
~Breakpad();
- void SetKeyValue(NSString *key, NSString *value);
- NSString *KeyValue(NSString *key);
- void RemoveKeyValue(NSString *key);
- NSArray *CrashReportsToUpload();
- NSString *NextCrashReportToUpload();
- NSDictionary *NextCrashReportConfiguration();
- NSDictionary *FixedUpCrashReportConfiguration(NSDictionary *configuration);
- NSDate *DateOfMostRecentCrashReport();
- void UploadNextReport(NSDictionary *server_parameters);
- void UploadReportWithConfiguration(NSDictionary *configuration,
- NSDictionary *server_parameters,
+ void SetKeyValue(NSString* key, NSString* value);
+ NSString* KeyValue(NSString* key);
+ void RemoveKeyValue(NSString* key);
+ NSArray* CrashReportsToUpload();
+ NSString* NextCrashReportToUpload();
+ NSDictionary* NextCrashReportConfiguration();
+ NSDictionary* FixedUpCrashReportConfiguration(NSDictionary* configuration);
+ NSDate* DateOfMostRecentCrashReport();
+ void UploadNextReport(NSDictionary* server_parameters);
+ void UploadReportWithConfiguration(NSDictionary* configuration,
+ NSDictionary* server_parameters,
BreakpadUploadCompletionCallback callback);
- void UploadData(NSData *data, NSString *name,
- NSDictionary *server_parameters);
- void HandleNetworkResponse(NSDictionary *configuration,
- NSData *data,
- NSError *error);
- NSDictionary *GenerateReport(NSDictionary *server_parameters);
+ void UploadData(NSData* data, NSString* name,
+ NSDictionary* server_parameters);
+ void HandleNetworkResponse(NSDictionary* configuration,
+ NSData* data,
+ NSError* error);
+ NSDictionary* GenerateReport(NSDictionary* server_parameters);
private:
Breakpad()
: handler_(NULL),
config_params_(NULL) {}
- bool Initialize(NSDictionary *parameters);
+ bool Initialize(NSDictionary* parameters);
- bool ExtractParameters(NSDictionary *parameters);
+ bool ExtractParameters(NSDictionary* parameters);
// Dispatches to HandleMinidump()
- static bool HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context, bool succeeded);
+ static bool HandleMinidumpCallback(const char* dump_dir,
+ const char* minidump_id,
+ void* context, bool succeeded);
- bool HandleMinidump(const char *dump_dir,
- const char *minidump_id);
+ bool HandleMinidump(const char* dump_dir,
+ const char* minidump_id);
// NSException handler
- static void UncaughtExceptionHandler(NSException *exception);
+ static void UncaughtExceptionHandler(NSException* exception);
// Handle an uncaught NSException.
- void HandleUncaughtException(NSException *exception);
+ void HandleUncaughtException(NSException* exception);
// Since ExceptionHandler (w/o namespace) is defined as typedef in OSX's
// MachineExceptions.h, we have to explicitly name the handler.
- google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
+ google_breakpad::ExceptionHandler* handler_; // The actual handler (STRONG)
- LongStringDictionary *config_params_; // Create parameters (STRONG)
+ LongStringDictionary* config_params_; // Create parameters (STRONG)
ConfigFile config_file_;
// A static reference to the current Breakpad instance. Used for handling
// NSException.
- static Breakpad *current_breakpad_;
+ static Breakpad* current_breakpad_;
};
-Breakpad *Breakpad::current_breakpad_ = NULL;
+Breakpad* Breakpad::current_breakpad_ = NULL;
#pragma mark -
#pragma mark Helper functions
@@ -221,14 +221,14 @@ Breakpad *Breakpad::current_breakpad_ = NULL;
//=============================================================================
static BOOL IsDebuggerActive() {
BOOL result = NO;
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
+ NSUserDefaults* stdDefaults = [NSUserDefaults standardUserDefaults];
// We check both defaults and the environment variable here
BOOL ignoreDebugger = [stdDefaults boolForKey:@IGNORE_DEBUGGER];
if (!ignoreDebugger) {
- char *ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
+ char* ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
ignoreDebugger =
(ignoreDebuggerStr ? strtol(ignoreDebuggerStr, NULL, 10) : 0) != 0;
}
@@ -240,7 +240,7 @@ static BOOL IsDebuggerActive() {
size_t actualSize;
if (sysctl(mib, mibSize, NULL, &actualSize, NULL, 0) == 0) {
- struct kinfo_proc *info = (struct kinfo_proc *)malloc(actualSize);
+ struct kinfo_proc* info = (struct kinfo_proc*)malloc(actualSize);
if (info) {
// This comes from looking at the Darwin xnu Kernel
@@ -256,10 +256,10 @@ static BOOL IsDebuggerActive() {
}
//=============================================================================
-bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context, bool succeeded) {
- Breakpad *breakpad = (Breakpad *)context;
+bool Breakpad::HandleMinidumpCallback(const char* dump_dir,
+ const char* minidump_id,
+ void* context, bool succeeded) {
+ Breakpad* breakpad = (Breakpad*)context;
// If our context is damaged or something, just return false to indicate that
// the handler should continue without us.
@@ -270,7 +270,7 @@ bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
}
//=============================================================================
-void Breakpad::UncaughtExceptionHandler(NSException *exception) {
+void Breakpad::UncaughtExceptionHandler(NSException* exception) {
NSSetUncaughtExceptionHandler(NULL);
if (current_breakpad_) {
current_breakpad_->HandleUncaughtException(exception);
@@ -282,7 +282,7 @@ void Breakpad::UncaughtExceptionHandler(NSException *exception) {
#pragma mark -
//=============================================================================
-bool Breakpad::Initialize(NSDictionary *parameters) {
+bool Breakpad::Initialize(NSDictionary* parameters) {
// Initialize
current_breakpad_ = this;
config_params_ = NULL;
@@ -325,21 +325,21 @@ Breakpad::~Breakpad() {
}
//=============================================================================
-bool Breakpad::ExtractParameters(NSDictionary *parameters) {
- NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
- NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
- NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
- NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
- NSString *vendor =
+bool Breakpad::ExtractParameters(NSDictionary* parameters) {
+ NSString* serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
+ NSString* display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
+ NSString* product = [parameters objectForKey:@BREAKPAD_PRODUCT];
+ NSString* version = [parameters objectForKey:@BREAKPAD_VERSION];
+ NSString* urlStr = [parameters objectForKey:@BREAKPAD_URL];
+ NSString* vendor =
[parameters objectForKey:@BREAKPAD_VENDOR];
// We check both parameters and the environment variable here.
- char *envVarDumpSubdirectory = getenv(BREAKPAD_DUMP_DIRECTORY);
- NSString *dumpSubdirectory = envVarDumpSubdirectory ?
+ char* envVarDumpSubdirectory = getenv(BREAKPAD_DUMP_DIRECTORY);
+ NSString* dumpSubdirectory = envVarDumpSubdirectory ?
[NSString stringWithUTF8String:envVarDumpSubdirectory] :
[parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY];
- NSDictionary *serverParameters =
+ NSDictionary* serverParameters =
[parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT];
if (!product)
@@ -360,7 +360,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
if (!dumpSubdirectory) {
- NSString *cachePath =
+ NSString* cachePath =
[NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
NSUserDomainMask,
YES)
@@ -388,7 +388,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
new (gKeyValueAllocator->Allocate(sizeof(LongStringDictionary)))
LongStringDictionary();
- LongStringDictionary &dictionary = *config_params_;
+ LongStringDictionary& dictionary = *config_params_;
dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
@@ -407,8 +407,8 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
if (serverParameters) {
// For each key-value pair, call BreakpadAddUploadParameter()
- NSEnumerator *keyEnumerator = [serverParameters keyEnumerator];
- NSString *aParameter;
+ NSEnumerator* keyEnumerator = [serverParameters keyEnumerator];
+ NSString* aParameter;
while ((aParameter = [keyEnumerator nextObject])) {
BreakpadAddUploadParameter(this, aParameter,
[serverParameters objectForKey:aParameter]);
@@ -418,7 +418,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
//=============================================================================
-void Breakpad::SetKeyValue(NSString *key, NSString *value) {
+void Breakpad::SetKeyValue(NSString* key, NSString* value) {
// We allow nil values. This is the same as removing the keyvalue.
if (!config_params_ || !key)
return;
@@ -427,7 +427,7 @@ void Breakpad::SetKeyValue(NSString *key, NSString *value) {
}
//=============================================================================
-NSString *Breakpad::KeyValue(NSString *key) {
+NSString* Breakpad::KeyValue(NSString* key) {
if (!config_params_ || !key)
return nil;
@@ -436,44 +436,44 @@ NSString *Breakpad::KeyValue(NSString *key) {
}
//=============================================================================
-void Breakpad::RemoveKeyValue(NSString *key) {
+void Breakpad::RemoveKeyValue(NSString* key) {
if (!config_params_ || !key) return;
config_params_->RemoveKey([key UTF8String]);
}
//=============================================================================
-NSArray *Breakpad::CrashReportsToUpload() {
- NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
+NSArray* Breakpad::CrashReportsToUpload() {
+ NSString* directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
if (!directory)
return nil;
- NSArray *dirContents = [[NSFileManager defaultManager]
+ NSArray* dirContents = [[NSFileManager defaultManager]
contentsOfDirectoryAtPath:directory error:nil];
- NSArray *configs = [dirContents filteredArrayUsingPredicate:[NSPredicate
+ NSArray* configs = [dirContents filteredArrayUsingPredicate:[NSPredicate
predicateWithFormat:@"self BEGINSWITH 'Config-'"]];
return configs;
}
//=============================================================================
-NSString *Breakpad::NextCrashReportToUpload() {
- NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
+NSString* Breakpad::NextCrashReportToUpload() {
+ NSString* directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
if (!directory)
return nil;
- NSString *config = [CrashReportsToUpload() lastObject];
+ NSString* config = [CrashReportsToUpload() lastObject];
if (!config)
return nil;
return [NSString stringWithFormat:@"%@/%@", directory, config];
}
//=============================================================================
-NSDictionary *Breakpad::NextCrashReportConfiguration() {
- NSDictionary *configuration = [Uploader readConfigurationDataFromFile:NextCrashReportToUpload()];
+NSDictionary* Breakpad::NextCrashReportConfiguration() {
+ NSDictionary* configuration = [Uploader readConfigurationDataFromFile:NextCrashReportToUpload()];
return FixedUpCrashReportConfiguration(configuration);
}
//=============================================================================
-NSDictionary *Breakpad::FixedUpCrashReportConfiguration(NSDictionary *configuration) {
- NSMutableDictionary *fixedConfiguration = [[configuration mutableCopy] autorelease];
+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)
@@ -482,19 +482,19 @@ NSDictionary *Breakpad::FixedUpCrashReportConfiguration(NSDictionary *configurat
}
//=============================================================================
-NSDate *Breakpad::DateOfMostRecentCrashReport() {
- NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
+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
+ 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 =
+ 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;
@@ -506,29 +506,29 @@ NSDate *Breakpad::DateOfMostRecentCrashReport() {
}
//=============================================================================
-void Breakpad::HandleNetworkResponse(NSDictionary *configuration,
- NSData *data,
- NSError *error) {
- Uploader *uploader = [[[Uploader alloc]
+void Breakpad::HandleNetworkResponse(NSDictionary* configuration,
+ NSData* data,
+ NSError* error) {
+ Uploader* uploader = [[[Uploader alloc]
initWithConfig:configuration] autorelease];
[uploader handleNetworkResponse:data withError:error];
}
//=============================================================================
void Breakpad::UploadReportWithConfiguration(
- NSDictionary *configuration,
- NSDictionary *server_parameters,
+ NSDictionary* configuration,
+ NSDictionary* server_parameters,
BreakpadUploadCompletionCallback callback) {
- Uploader *uploader = [[[Uploader alloc]
+ Uploader* uploader = [[[Uploader alloc]
initWithConfig:configuration] autorelease];
if (!uploader)
return;
- for (NSString *key in server_parameters) {
+ for (NSString* key in server_parameters) {
[uploader addServerParameter:[server_parameters objectForKey:key]
forKey:key];
}
if (callback) {
- [uploader setUploadCompletionBlock:^(NSString *report_id, NSError *error) {
+ [uploader setUploadCompletionBlock:^(NSString* report_id, NSError* error) {
dispatch_async(dispatch_get_main_queue(), ^{
callback(report_id, error);
});
@@ -538,8 +538,8 @@ void Breakpad::UploadReportWithConfiguration(
}
//=============================================================================
-void Breakpad::UploadNextReport(NSDictionary *server_parameters) {
- NSDictionary *configuration = NextCrashReportConfiguration();
+void Breakpad::UploadNextReport(NSDictionary* server_parameters) {
+ NSDictionary* configuration = NextCrashReportConfiguration();
if (configuration) {
return UploadReportWithConfiguration(configuration, server_parameters,
nullptr);
@@ -547,19 +547,19 @@ void Breakpad::UploadNextReport(NSDictionary *server_parameters) {
}
//=============================================================================
-void Breakpad::UploadData(NSData *data, NSString *name,
- NSDictionary *server_parameters) {
- NSMutableDictionary *config = [NSMutableDictionary dictionary];
+void Breakpad::UploadData(NSData* data, NSString* name,
+ NSDictionary* server_parameters) {
+ NSMutableDictionary* config = [NSMutableDictionary dictionary];
LongStringDictionary::Iterator it(*config_params_);
- while (const LongStringDictionary::Entry *next = it.Next()) {
+ while (const LongStringDictionary::Entry* next = it.Next()) {
[config setValue:[NSString stringWithUTF8String:next->value]
forKey:[NSString stringWithUTF8String:next->key]];
}
- Uploader *uploader =
+ Uploader* uploader =
[[[Uploader alloc] initWithConfig:config] autorelease];
- for (NSString *key in server_parameters) {
+ for (NSString* key in server_parameters) {
[uploader addServerParameter:[server_parameters objectForKey:key]
forKey:key];
}
@@ -567,11 +567,11 @@ void Breakpad::UploadData(NSData *data, NSString *name,
}
//=============================================================================
-NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
- NSString *dumpDirAsNSString = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
+NSDictionary* Breakpad::GenerateReport(NSDictionary* server_parameters) {
+ NSString* dumpDirAsNSString = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
if (!dumpDirAsNSString)
return nil;
- const char *dumpDir = [dumpDirAsNSString UTF8String];
+ const char* dumpDir = [dumpDirAsNSString UTF8String];
google_breakpad::MinidumpGenerator generator(mach_task_self(),
MACH_PORT_NULL);
@@ -582,7 +582,7 @@ NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
return nil;
LongStringDictionary params = *config_params_;
- for (NSString *key in server_parameters) {
+ for (NSString* key in server_parameters) {
params.SetKeyValue([key UTF8String],
[[server_parameters objectForKey:key] UTF8String]);
}
@@ -590,8 +590,8 @@ NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
config_file.WriteFile(dumpDir, &params, dumpDir, dumpId.c_str());
// Handle results.
- NSMutableDictionary *result = [NSMutableDictionary dictionary];
- NSString *dumpFullPath = [NSString stringWithUTF8String:dumpFilename.c_str()];
+ NSMutableDictionary* result = [NSMutableDictionary dictionary];
+ NSString* dumpFullPath = [NSString stringWithUTF8String:dumpFilename.c_str()];
[result setValue:dumpFullPath
forKey:@BREAKPAD_OUTPUT_DUMP_FILE];
[result setValue:[NSString stringWithUTF8String:config_file.GetFilePath()]
@@ -600,8 +600,8 @@ NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
}
//=============================================================================
-bool Breakpad::HandleMinidump(const char *dump_dir,
- const char *minidump_id) {
+bool Breakpad::HandleMinidump(const char* dump_dir,
+ const char* minidump_id) {
config_file_.WriteFile(dump_dir,
config_params_,
dump_dir,
@@ -613,7 +613,7 @@ bool Breakpad::HandleMinidump(const char *dump_dir,
}
//=============================================================================
-void Breakpad::HandleUncaughtException(NSException *exception) {
+void Breakpad::HandleUncaughtException(NSException* exception) {
// Generate the minidump.
google_breakpad::IosExceptionMinidumpGenerator generator(exception);
const std::string minidump_path =
@@ -650,7 +650,7 @@ void Breakpad::HandleUncaughtException(NSException *exception) {
#pragma mark Public API
//=============================================================================
-BreakpadRef BreakpadCreate(NSDictionary *parameters) {
+BreakpadRef BreakpadCreate(NSDictionary* parameters) {
try {
// This is confusing. Our two main allocators for breakpad memory are:
// - gKeyValueAllocator for the key/value memory
@@ -690,8 +690,8 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
ProtectedMemoryAllocator(breakpad_pool_size);
// Stack-based autorelease pool for Breakpad::Create() obj-c code.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Breakpad *breakpad = Breakpad::Create(parameters);
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ Breakpad* breakpad = Breakpad::Create(parameters);
if (breakpad) {
// Make read-only to protect against memory smashers
@@ -731,7 +731,7 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
//=============================================================================
void BreakpadRelease(BreakpadRef ref) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (gMasterAllocator) {
gMasterAllocator->Unprotect();
@@ -764,10 +764,10 @@ void BreakpadRelease(BreakpadRef ref) {
}
//=============================================================================
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
+void BreakpadSetKeyValue(BreakpadRef ref, NSString* key, NSString* value) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
@@ -780,20 +780,20 @@ void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
}
void BreakpadAddUploadParameter(BreakpadRef ref,
- NSString *key,
- NSString *value) {
+ NSString* key,
+ NSString* value) {
// The only difference, internally, between an upload parameter and
// a key value one that is set with BreakpadSetKeyValue is that we
// prepend the keyname with a special prefix. This informs the
// crash sender that the parameter should be sent along with the
// POST of the crash dump upload.
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
- NSString *prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
+ NSString* prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
stringByAppendingString:key];
breakpad->SetKeyValue(prefixedKey, value);
}
@@ -803,15 +803,15 @@ void BreakpadAddUploadParameter(BreakpadRef ref,
}
void BreakpadRemoveUploadParameter(BreakpadRef ref,
- NSString *key) {
+ NSString* key) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
- NSString *prefixedKey = [NSString stringWithFormat:@"%@%@",
+ NSString* prefixedKey = [NSString stringWithFormat:@"%@%@",
@BREAKPAD_SERVER_PARAMETER_PREFIX, key];
breakpad->RemoveKeyValue(prefixedKey);
}
@@ -820,12 +820,12 @@ void BreakpadRemoveUploadParameter(BreakpadRef ref,
}
}
//=============================================================================
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
- NSString *value = nil;
+NSString* BreakpadKeyValue(BreakpadRef ref, NSString* key) {
+ NSString* value = nil;
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (!breakpad || !key || !gKeyValueAllocator)
return nil;
@@ -841,10 +841,10 @@ NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
}
//=============================================================================
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
+void BreakpadRemoveKeyValue(BreakpadRef ref, NSString* key) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
@@ -860,7 +860,7 @@ void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
int BreakpadGetCrashReportCount(BreakpadRef ref) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad) {
return static_cast<int>([breakpad->CrashReportsToUpload() count]);
@@ -877,9 +877,9 @@ void BreakpadUploadNextReport(BreakpadRef ref) {
}
//=============================================================================
-NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref) {
+NSDictionary* BreakpadGetNextReportConfiguration(BreakpadRef ref) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad)
return breakpad->NextCrashReportConfiguration();
} catch(...) { // don't let exceptions leave this C API
@@ -889,9 +889,9 @@ NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref) {
}
//=============================================================================
-NSDate *BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref) {
+NSDate* BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad) {
return breakpad->DateOfMostRecentCrashReport();
}
@@ -904,11 +904,11 @@ NSDate *BreakpadGetDateOfMostRecentCrashReport(BreakpadRef ref) {
//=============================================================================
void BreakpadUploadReportWithParametersAndConfiguration(
BreakpadRef ref,
- NSDictionary *server_parameters,
- NSDictionary *configuration,
+ NSDictionary* server_parameters,
+ NSDictionary* configuration,
BreakpadUploadCompletionCallback callback) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (!breakpad || !configuration)
return;
breakpad->UploadReportWithConfiguration(configuration, server_parameters,
@@ -922,13 +922,13 @@ void BreakpadUploadReportWithParametersAndConfiguration(
//=============================================================================
void BreakpadUploadNextReportWithParameters(
BreakpadRef ref,
- NSDictionary *server_parameters,
+ NSDictionary* server_parameters,
BreakpadUploadCompletionCallback callback) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (!breakpad)
return;
- NSDictionary *configuration = breakpad->NextCrashReportConfiguration();
+ NSDictionary* configuration = breakpad->NextCrashReportConfiguration();
if (!configuration)
return;
return BreakpadUploadReportWithParametersAndConfiguration(
@@ -939,12 +939,12 @@ void BreakpadUploadNextReportWithParameters(
}
void BreakpadHandleNetworkResponse(BreakpadRef ref,
- NSDictionary *configuration,
- NSData *data,
- NSError *error) {
+ NSDictionary* configuration,
+ NSData* data,
+ NSError* error) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && configuration)
breakpad->HandleNetworkResponse(configuration,data, error);
@@ -954,11 +954,11 @@ void BreakpadHandleNetworkResponse(BreakpadRef ref,
}
//=============================================================================
-void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name,
- NSDictionary *server_parameters) {
+void BreakpadUploadData(BreakpadRef ref, NSData* data, NSString* name,
+ NSDictionary* server_parameters) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad) {
breakpad->UploadData(data, name, server_parameters);
@@ -969,11 +969,11 @@ void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name,
}
//=============================================================================
-NSDictionary *BreakpadGenerateReport(BreakpadRef ref,
- NSDictionary *server_parameters) {
+NSDictionary* BreakpadGenerateReport(BreakpadRef ref,
+ NSDictionary* server_parameters) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad) {
return breakpad->GenerateReport(server_parameters);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc b/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc
index 7fcf2d83d2b..cb26449d0f9 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc
@@ -47,7 +47,7 @@
// for more details.
#if USE_PROTECTED_ALLOCATIONS
#include "client/mac/handler/protected_memory_allocator.h"
- extern ProtectedMemoryAllocator *gBreakpadAllocator;
+ extern ProtectedMemoryAllocator* gBreakpadAllocator;
#endif
namespace google_breakpad {
@@ -72,10 +72,10 @@ static union {
char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
#endif // defined PAGE_MAX_SIZE
#endif // USE_PROTECTED_ALLOCATIONS
- google_breakpad::ExceptionHandler *handler;
+ google_breakpad::ExceptionHandler* handler;
} gProtectedData;
-ExceptionHandler::ExceptionHandler(const string &dump_path,
+ExceptionHandler::ExceptionHandler(const string& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.h b/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.h
index 6d99565b55c..ec598dcf329 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.h
@@ -53,7 +53,7 @@ class ExceptionHandler {
// 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);
+ 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
@@ -63,18 +63,18 @@ class ExceptionHandler {
// 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);
+ 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);
+ 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
@@ -84,22 +84,22 @@ class ExceptionHandler {
// 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,
+ ExceptionHandler(const string& dump_path,
FilterCallback filter, MinidumpCallback callback,
- void *callback_context, bool install_handler,
- const char *port_name);
+ 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,
+ 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) {
+ 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_.
@@ -126,7 +126,7 @@ class ExceptionHandler {
bool WriteMinidumpWithException(int exception_type,
int exception_code,
int exception_subcode,
- breakpad_ucontext_t *task_context,
+ breakpad_ucontext_t* task_context,
mach_port_t thread_name,
bool exit_after_write,
bool report_current_thread);
@@ -135,8 +135,8 @@ class ExceptionHandler {
static void SignalHandler(int sig, siginfo_t* info, void* uc);
// disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
+ 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_.
@@ -152,15 +152,15 @@ class ExceptionHandler {
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_;
+ 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_;
+ void* callback_context_;
// The callback function to be passed back when we don't want a minidump
// file to be written
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.h b/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.h
index 21133e63295..e48444a72d4 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.h
@@ -41,12 +41,12 @@ namespace google_breakpad {
class IosExceptionMinidumpGenerator : public MinidumpGenerator {
public:
- explicit IosExceptionMinidumpGenerator(NSException *exception);
+ explicit IosExceptionMinidumpGenerator(NSException* exception);
virtual ~IosExceptionMinidumpGenerator();
protected:
- virtual bool WriteExceptionStream(MDRawDirectory *exception_stream);
- virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread);
+ virtual bool WriteExceptionStream(MDRawDirectory* exception_stream);
+ virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread* thread);
private:
@@ -57,16 +57,16 @@ class IosExceptionMinidumpGenerator : public MinidumpGenerator {
uintptr_t GetLRFromException();
// Write a virtual thread context for the crashing site.
- bool WriteCrashingContext(MDLocationDescriptor *register_location);
+ bool WriteCrashingContext(MDLocationDescriptor* register_location);
// Per-CPU implementations of the above method.
#ifdef HAS_ARM_SUPPORT
- bool WriteCrashingContextARM(MDLocationDescriptor *register_location);
+ bool WriteCrashingContextARM(MDLocationDescriptor* register_location);
#endif
#ifdef HAS_ARM64_SUPPORT
- bool WriteCrashingContextARM64(MDLocationDescriptor *register_location);
+ bool WriteCrashingContextARM64(MDLocationDescriptor* register_location);
#endif
- NSArray *return_addresses_;
+ NSArray* return_addresses_;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm b/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
index f57bdf2164b..2a5d76d7b31 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
@@ -52,7 +52,7 @@ const uintptr_t kExpectedFinalSp = 0;
// Append the given value to the sp position of the stack represented
// by memory.
-void AppendToMemory(uint8_t *memory, uintptr_t sp, uintptr_t data) {
+void AppendToMemory(uint8_t* memory, uintptr_t sp, uintptr_t data) {
memcpy(memory + sp, &data, sizeof(data));
}
#endif
@@ -62,7 +62,7 @@ void AppendToMemory(uint8_t *memory, uintptr_t sp, uintptr_t data) {
namespace google_breakpad {
IosExceptionMinidumpGenerator::IosExceptionMinidumpGenerator(
- NSException *exception)
+ NSException* exception)
: MinidumpGenerator(mach_task_self(), 0) {
return_addresses_ = [[exception callStackReturnAddresses] retain];
SetExceptionInformation(kExceptionType,
@@ -76,7 +76,7 @@ IosExceptionMinidumpGenerator::~IosExceptionMinidumpGenerator() {
}
bool IosExceptionMinidumpGenerator::WriteCrashingContext(
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
#ifdef HAS_ARM_SUPPORT
return WriteCrashingContextARM(register_location);
#elif defined(HAS_ARM64_SUPPORT)
@@ -89,12 +89,12 @@ bool IosExceptionMinidumpGenerator::WriteCrashingContext(
#ifdef HAS_ARM_SUPPORT
bool IosExceptionMinidumpGenerator::WriteCrashingContextARM(
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
TypedMDRVA<MDRawContextARM> context(&writer_);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextARM *context_ptr = context.get();
+ MDRawContextARM* context_ptr = context.get();
memset(context_ptr, 0, sizeof(MDRawContextARM));
context_ptr->context_flags = MD_CONTEXT_ARM_FULL;
context_ptr->iregs[MD_CONTEXT_ARM_REG_IOS_FP] = kExpectedFinalFp; // FP
@@ -107,12 +107,12 @@ bool IosExceptionMinidumpGenerator::WriteCrashingContextARM(
#ifdef HAS_ARM64_SUPPORT
bool IosExceptionMinidumpGenerator::WriteCrashingContextARM64(
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextARM64_Old *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_OLD;
context_ptr->iregs[MD_CONTEXT_ARM64_REG_FP] = kExpectedFinalFp; // FP
@@ -132,7 +132,7 @@ uintptr_t IosExceptionMinidumpGenerator::GetLRFromException() {
}
bool IosExceptionMinidumpGenerator::WriteExceptionStream(
- MDRawDirectory *exception_stream) {
+ MDRawDirectory* exception_stream) {
#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
TypedMDRVA<MDRawExceptionStream> exception(&writer_);
@@ -141,7 +141,7 @@ bool IosExceptionMinidumpGenerator::WriteExceptionStream(
exception_stream->stream_type = MD_EXCEPTION_STREAM;
exception_stream->location = exception.location();
- MDRawExceptionStream *exception_ptr = exception.get();
+ MDRawExceptionStream* exception_ptr = exception.get();
exception_ptr->thread_id = pthread_mach_thread_np(pthread_self());
// This naming is confusing, but it is the proper translation from
@@ -160,7 +160,7 @@ bool IosExceptionMinidumpGenerator::WriteExceptionStream(
}
bool IosExceptionMinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
- MDRawThread *thread) {
+ MDRawThread* thread) {
#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
if (pthread_mach_thread_np(pthread_self()) != thread_id)
return MinidumpGenerator::WriteThreadStream(thread_id, thread);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/crash_generation/crash_generation_server.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/crash_generation/crash_generation_server.cc
index 26c50a5ccb8..8332f59d405 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/crash_generation/crash_generation_server.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/crash_generation/crash_generation_server.cc
@@ -229,7 +229,7 @@ CrashGenerationServer::ClientEvent(short revents)
// Walk the control payload and extract the file descriptor and validated pid.
pid_t crashing_pid = -1;
int signal_fd = -1;
- for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
+ for (struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg); hdr;
hdr = CMSG_NXTHDR(&msg, hdr)) {
if (hdr->cmsg_level != SOL_SOCKET)
continue;
@@ -248,7 +248,7 @@ CrashGenerationServer::ClientEvent(short revents)
signal_fd = reinterpret_cast<int*>(CMSG_DATA(hdr))[0];
}
} else if (hdr->cmsg_type == SCM_CREDENTIALS) {
- const struct ucred *cred =
+ const struct ucred* cred =
reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
crashing_pid = cred->pid;
}
@@ -324,7 +324,7 @@ CrashGenerationServer::MakeMinidumpFilename(string& outFilename)
// static
void*
-CrashGenerationServer::ThreadMain(void *arg)
+CrashGenerationServer::ThreadMain(void* arg)
{
reinterpret_cast<CrashGenerationServer*>(arg)->Run();
return NULL;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
index ee515c4153f..6eec1be2465 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
@@ -48,7 +48,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_EIP];
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
const fpstate_t* fp) {
const greg_t* regs = uc->uc_mcontext.gregs;
@@ -96,7 +96,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.gregs[REG_RIP];
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
const fpstate_t* fpregs) {
const greg_t* regs = uc->uc_mcontext.gregs;
@@ -153,7 +153,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.arm_pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *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;
@@ -192,7 +192,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
const struct fpsimd_context* fpregs) {
out->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
@@ -218,7 +218,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
return uc->uc_mcontext.pc;
}
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *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
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
index 8e74a8a5ac0..7d41008815f 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
@@ -50,13 +50,13 @@ struct UContextReader {
// out: the minidump structure
// info: the collection of register structures.
#if defined(__i386__) || defined(__x86_64)
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
const fpstate_t* fp);
#elif defined(__aarch64__)
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
const struct fpsimd_context* fpregs);
#else
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
+ static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc);
#endif
};
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
index c65feaa16dc..ca353c40997 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
@@ -419,8 +419,8 @@ struct ThreadArgument {
// This is the entry function for the cloned process. We are in a compromised
// context here: see the top of the file.
// static
-int ExceptionHandler::ThreadEntry(void *arg) {
- const ThreadArgument *thread_arg = reinterpret_cast<ThreadArgument*>(arg);
+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.
@@ -495,7 +495,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
}
// This function may run in a compromised context: see the top of the file.
-bool ExceptionHandler::GenerateDump(CrashContext *context) {
+bool ExceptionHandler::GenerateDump(CrashContext* context) {
if (IsOutOfProcess())
return crash_generation_client_->RequestDump(context, sizeof(*context));
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
index f44483ff0fd..f80843ea720 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
@@ -82,7 +82,7 @@ class ExceptionHandler {
// 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);
+ typedef bool (*FilterCallback)(void* context);
// A callback function to run after the minidump has been written.
// |descriptor| contains the file descriptor or file path containing the
@@ -234,7 +234,7 @@ class ExceptionHandler {
static void RestoreHandlersLocked();
void PreresolveSymbols();
- bool GenerateDump(CrashContext *context);
+ bool GenerateDump(CrashContext* context);
void SendContinueSignalToChild();
void WaitForContinueSignal();
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
index 8d8809fa8ba..35dcbfd4d86 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
@@ -201,7 +201,7 @@ static bool DoneCallback(const MinidumpDescriptor& descriptor,
// optimize them out. In the case of ExceptionHandlerTest::ExternalDumper,
// GCC-4.9 optimized out the entire set up of ExceptionHandler, causing
// test failure.
-volatile int *p_null; // external linkage, so GCC can't tell that it
+volatile int* p_null; // external linkage, so GCC can't tell that it
// remains NULL. Volatile just for a good measure.
static void DoNullPointerDereference() {
*p_null = 1;
@@ -994,7 +994,7 @@ CrashHandler(const void* crash_context, size_t crash_context_size,
msg.msg_control = cmsg;
msg.msg_controllen = sizeof(cmsg);
- struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg);
+ struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg);
hdr->cmsg_level = SOL_SOCKET;
hdr->cmsg_type = SCM_RIGHTS;
hdr->cmsg_len = CMSG_LEN(sizeof(int));
@@ -1003,7 +1003,7 @@ CrashHandler(const void* crash_context, size_t crash_context_size,
hdr->cmsg_level = SOL_SOCKET;
hdr->cmsg_type = SCM_CREDENTIALS;
hdr->cmsg_len = CMSG_LEN(sizeof(struct ucred));
- struct ucred *cred = reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
+ struct ucred* cred = reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
cred->uid = getuid();
cred->gid = getgid();
cred->pid = getpid();
@@ -1056,7 +1056,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) {
pid_t crashing_pid = -1;
int signal_fd = -1;
- for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
+ for (struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg); hdr;
hdr = CMSG_NXTHDR(&msg, hdr)) {
if (hdr->cmsg_level != SOL_SOCKET)
continue;
@@ -1066,7 +1066,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) {
ASSERT_EQ(sizeof(int), len);
signal_fd = *(reinterpret_cast<int*>(CMSG_DATA(hdr)));
} else if (hdr->cmsg_type == SCM_CREDENTIALS) {
- const struct ucred *cred =
+ const struct ucred* cred =
reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
crashing_pid = cred->pid;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/log/log.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/log/log.cc
index fc23aa6d528..318794095b0 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/log/log.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/log/log.cc
@@ -44,8 +44,8 @@ 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);
+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";
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc
index 326f9e36b48..7292a63685f 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc
@@ -47,7 +47,7 @@ typedef testing::Test DirectoryReaderTest;
TEST(DirectoryReaderTest, CompareResults) {
std::set<string> dent_set;
- DIR *const dir = opendir("/proc/self");
+ DIR* const dir = opendir("/proc/self");
ASSERT_TRUE(dir != NULL);
struct dirent* dent;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader.h b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader.h
index 779cfeb6039..9fc4b7cc887 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader.h
@@ -61,7 +61,7 @@ class LineReader {
//
// One must call |PopLine| after this function, otherwise you'll continue to
// get the same line over and over.
- bool GetNextLine(const char **line, unsigned *len) {
+ bool GetNextLine(const char** line, unsigned* len) {
for (;;) {
if (buf_used_ == 0 && hit_eof_)
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
index 29686f04aae..e1ac445ae9e 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
@@ -59,7 +59,7 @@ TEST(LineReaderTest, EmptyFile) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_FALSE(reader.GetNextLine(&line, &len));
}
@@ -69,7 +69,7 @@ TEST(LineReaderTest, OneLineTerminated) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned int len;
ASSERT_TRUE(reader.GetNextLine(&line, &len));
ASSERT_EQ((unsigned int)1, len);
@@ -85,7 +85,7 @@ TEST(LineReaderTest, OneLine) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_TRUE(reader.GetNextLine(&line, &len));
ASSERT_EQ((unsigned)1, len);
@@ -101,7 +101,7 @@ TEST(LineReaderTest, TwoLinesTerminated) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_TRUE(reader.GetNextLine(&line, &len));
ASSERT_EQ((unsigned)1, len);
@@ -123,7 +123,7 @@ TEST(LineReaderTest, TwoLines) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_TRUE(reader.GetNextLine(&line, &len));
ASSERT_EQ((unsigned)1, len);
@@ -147,7 +147,7 @@ TEST(LineReaderTest, MaxLength) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_TRUE(reader.GetNextLine(&line, &len));
ASSERT_EQ(sizeof(l), len);
@@ -163,7 +163,7 @@ TEST(LineReaderTest, TooLong) {
ASSERT_TRUE(file.IsOk());
LineReader reader(file.GetFd());
- const char *line;
+ const char* line;
unsigned len;
ASSERT_FALSE(reader.GetNextLine(&line, &len));
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
index 1112035bc5a..7fd6532ad25 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
@@ -135,7 +135,7 @@ const size_t kHpageMask = (~(kHpageSize - 1));
// next is backed by some file.
// curr and next are contiguous.
// offset(next) == sizeof(curr)
-void TryRecoverMappings(MappingInfo *curr, MappingInfo *next) {
+void TryRecoverMappings(MappingInfo* curr, MappingInfo* next) {
// Merged segments are marked with size = 0.
if (curr->size == 0 || next->size == 0)
return;
@@ -167,8 +167,8 @@ void TryRecoverMappings(MappingInfo *curr, MappingInfo *next) {
// 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) {
+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;
@@ -551,11 +551,11 @@ bool LinuxDumper::EnumerateMappings() {
// See http://www.trilithium.com/johan/2005/08/linux-gate/ for more
// information.
const void* linux_gate_loc =
- reinterpret_cast<void *>(auxv_[AT_SYSINFO_EHDR]);
+ reinterpret_cast<void*>(auxv_[AT_SYSINFO_EHDR]);
// Although the initial executable is usually the first mapping, it's not
// guaranteed (see http://crosbug.com/25355); therefore, try to use the
// actual entry point to find the mapping.
- const void* entry_point_loc = reinterpret_cast<void *>(auxv_[AT_ENTRY]);
+ const void* entry_point_loc = reinterpret_cast<void*>(auxv_[AT_ENTRY]);
const int fd = sys_open(maps_path, O_RDONLY, 0);
if (fd < 0)
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
index f4a75d90609..7bee160f1ab 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
@@ -110,8 +110,8 @@ class LinuxDumper {
}
// 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 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
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
index 3ad48e50155..331f4bb346c 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -55,8 +55,8 @@
#error This test has not been ported to this platform.
#endif
-void *thread_function(void *data) {
- int pipefd = *static_cast<int *>(data);
+void* thread_function(void* data) {
+ int pipefd = *static_cast<int*>(data);
volatile pid_t* thread_id = new pid_t;
*thread_id = syscall(__NR_gettid);
// Signal parent that a thread has started.
@@ -65,13 +65,13 @@ void *thread_function(void *data) {
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;
}
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
if (argc < 3) {
fprintf(stderr,
"usage: linux_dumper_unittest_helper <pipe fd> <# of threads>\n");
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
index ea6b9a12e0d..da71e15dc01 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
@@ -337,7 +337,7 @@ TEST_F(LinuxPtraceDumperChildTest, MappingsIncludeLinuxGate) {
ASSERT_TRUE(dumper.Init());
void* linux_gate_loc =
- reinterpret_cast<void *>(dumper.auxv()[AT_SYSINFO_EHDR]);
+ reinterpret_cast<void*>(dumper.auxv()[AT_SYSINFO_EHDR]);
ASSERT_TRUE(linux_gate_loc);
bool found_linux_gate = false;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
index f8cdf2a1c6a..32634ef002a 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
@@ -740,14 +740,14 @@ class MinidumpWriter {
}
bool WriteDSODebugStream(MDRawDirectory* dirent) {
- ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr) *>(dumper_->auxv()[AT_PHDR]);
+ ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr)*>(dumper_->auxv()[AT_PHDR]);
char* base;
int phnum = dumper_->auxv()[AT_PHNUM];
if (!phnum || !phdr)
return false;
// Assume the program base is at the beginning of the same page as the PHDR
- base = reinterpret_cast<char *>(reinterpret_cast<uintptr_t>(phdr) & ~0xfff);
+ base = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(phdr) & ~0xfff);
// Search for the program PT_DYNAMIC segment
ElfW(Addr) dyn_addr = 0;
@@ -768,7 +768,7 @@ class MinidumpWriter {
if (!dyn_addr)
return false;
- ElfW(Dyn) *dynamic = reinterpret_cast<ElfW(Dyn) *>(dyn_addr + base);
+ ElfW(Dyn)* dynamic = reinterpret_cast<ElfW(Dyn)*>(dyn_addr + base);
// The dynamic linker makes information available that helps gdb find all
// DSOs loaded into the program. If this information is indeed available,
@@ -1222,7 +1222,7 @@ class MinidumpWriter {
Buffers* next;
size_t len;
uint8_t data[kBufSize];
- } *buffers = reinterpret_cast<Buffers*>(Alloc(sizeof(Buffers)));
+ }* buffers = reinterpret_cast<Buffers*>(Alloc(sizeof(Buffers)));
buffers->next = NULL;
buffers->len = 0;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
index 3017a49ae93..ac93a3430d6 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
@@ -299,10 +299,10 @@ TEST(MinidumpWriterTest, MinidumpStacksSkippedIfRequested) {
Minidump minidump(templ);
ASSERT_TRUE(minidump.Read());
- MinidumpThreadList *threads = minidump.GetThreadList();
+ MinidumpThreadList* threads = minidump.GetThreadList();
int threads_with_stacks = 0;
for (unsigned int i = 0; i < threads->thread_count(); ++i) {
- MinidumpThread *thread = threads->GetThreadAtIndex(i);
+ MinidumpThread* thread = threads->GetThreadAtIndex(i);
if (thread->GetMemory()) {
++threads_with_stacks;
}
@@ -353,13 +353,13 @@ TEST(MinidumpWriterTest, StacksAreSanitizedIfRequested) {
#else
0x0defaced;
#endif
- MinidumpThreadList *threads = minidump.GetThreadList();
+ MinidumpThreadList* threads = minidump.GetThreadList();
for (unsigned int i = 0; i < threads->thread_count(); ++i) {
- MinidumpThread *thread = threads->GetThreadAtIndex(i);
- MinidumpMemoryRegion *mem = thread->GetMemory();
+ MinidumpThread* thread = threads->GetThreadAtIndex(i);
+ MinidumpMemoryRegion* mem = thread->GetMemory();
ASSERT_TRUE(mem != nullptr);
uint32_t sz = mem->GetSize();
- const uint8_t *data = mem->GetMemory();
+ const uint8_t* data = mem->GetMemory();
ASSERT_TRUE(memmem(data, sz, &defaced, sizeof(defaced)) != nullptr);
}
close(fds[1]);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
index 9f46fa65c84..8e2319e76c1 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
@@ -41,7 +41,7 @@ namespace google_breakpad {
string GetHelperBinary() {
string helper_path;
- char *bindir = getenv("bindir");
+ char* bindir = getenv("bindir");
if (bindir) {
helper_path = string(bindir) + "/";
} else {
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
index 6037c7e6654..d9b1203e4d6 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
@@ -65,7 +65,7 @@ TEST(ProcCpuInfoReaderTest, EmptyFile) {
ASSERT_TRUE(file.IsOk());
ProcCpuInfoReader reader(file.GetFd());
- const char *field;
+ const char* field;
ASSERT_FALSE(reader.GetNextField(&field));
}
@@ -74,7 +74,7 @@ TEST(ProcCpuInfoReaderTest, OneLineTerminated) {
ASSERT_TRUE(file.IsOk());
ProcCpuInfoReader reader(file.GetFd());
- const char *field;
+ const char* field;
ASSERT_TRUE(reader.GetNextField(&field));
ASSERT_STREQ("foo", field);
ASSERT_STREQ("bar", reader.GetValue());
@@ -87,7 +87,7 @@ TEST(ProcCpuInfoReaderTest, OneLine) {
ASSERT_TRUE(file.IsOk());
ProcCpuInfoReader reader(file.GetFd());
- const char *field;
+ const char* field;
size_t value_len;
ASSERT_TRUE(reader.GetNextField(&field));
ASSERT_STREQ("foo", field);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc b/chromium/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc
index f83a0e89829..6bf337a8df6 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/linux/sender/google_crash_report_sender.cc
@@ -84,7 +84,7 @@ bool CheckForRequiredFlagsOrDie() {
return true;
}
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
google::InitGoogleLogging(argv[0]);
google::ParseCommandLineFlags(&argc, &argv, true);
if (!CheckForRequiredFlagsOrDie()) {
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.h b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.h
index dc7e45d1c8a..9e191ce270d 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.h
@@ -45,7 +45,7 @@
// OnDemandServer and restored in Inspector.
#define BREAKPAD_BOOTSTRAP_PARENT_PORT "com.Breakpad.BootstrapParent"
-typedef void *BreakpadRef;
+typedef void* BreakpadRef;
#ifdef __cplusplus
extern "C" {
@@ -65,7 +65,7 @@ extern "C" {
typedef bool (*BreakpadFilterCallback)(int exception_type,
int exception_code,
mach_port_t crashing_thread,
- void *context);
+ void* context);
// Create a new BreakpadRef object and install it as an exception
// handler. The |parameters| will typically be the contents of your
@@ -226,7 +226,7 @@ typedef bool (*BreakpadFilterCallback)(int exception_type,
// Only used in crash_report_sender.
// Returns a new BreakpadRef object on success, NULL otherwise.
-BreakpadRef BreakpadCreate(NSDictionary *parameters);
+BreakpadRef BreakpadCreate(NSDictionary* parameters);
// Uninstall and release the data associated with |ref|.
void BreakpadRelease(BreakpadRef ref);
@@ -238,7 +238,7 @@ void BreakpadRelease(BreakpadRef ref);
// Context is a pointer to arbitrary data to make the callback with.
void BreakpadSetFilterCallback(BreakpadRef ref,
BreakpadFilterCallback callback,
- void *context);
+ void* context);
// User defined key and value string storage. Generally this is used
// to configure Breakpad's internal operation, such as whether the
@@ -259,23 +259,23 @@ void BreakpadSetFilterCallback(BreakpadRef ref,
// TODO (nealsid): separate server parameter dictionary from the
// dictionary used to configure Breakpad, and document limits for each
// independently.
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value);
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key);
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key);
+void BreakpadSetKeyValue(BreakpadRef ref, NSString* key, NSString* value);
+NSString* BreakpadKeyValue(BreakpadRef ref, NSString* key);
+void BreakpadRemoveKeyValue(BreakpadRef ref, NSString* key);
// You can use this method to specify parameters that will be uploaded
// to the crash server. They will be automatically encoded as
// necessary. Note that as mentioned above there are limits on both
// the number of keys and their length.
-void BreakpadAddUploadParameter(BreakpadRef ref, NSString *key,
- NSString *value);
+void BreakpadAddUploadParameter(BreakpadRef ref, NSString* key,
+ NSString* value);
// This method will remove a previously-added parameter from the
// upload parameter set.
-void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key);
+void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString* key);
// Add a log file for Breakpad to read and send upon crash dump
-void BreakpadAddLogFile(BreakpadRef ref, NSString *logPathname);
+void BreakpadAddLogFile(BreakpadRef ref, NSString* logPathname);
// Generate a minidump and send
void BreakpadGenerateAndSendReport(BreakpadRef ref);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.mm b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.mm
index b21405495c0..1a46b5977c1 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/Breakpad.mm
@@ -81,9 +81,9 @@ using google_breakpad::SimpleStringDictionary;
// allocation of C++ objects. Note that we don't use operator delete()
// but instead call the objects destructor directly: object->~ClassName();
//
-ProtectedMemoryAllocator *gMasterAllocator = NULL;
-ProtectedMemoryAllocator *gKeyValueAllocator = NULL;
-ProtectedMemoryAllocator *gBreakpadAllocator = NULL;
+ProtectedMemoryAllocator* gMasterAllocator = NULL;
+ProtectedMemoryAllocator* gKeyValueAllocator = NULL;
+ProtectedMemoryAllocator* gBreakpadAllocator = NULL;
// Mutex for thread-safe access to the key/value dictionary used by breakpad.
// It's a global instead of an instance variable of Breakpad
@@ -98,8 +98,8 @@ pthread_mutex_t gDictionaryMutex;
// Its destructor will first re-protect the memory then release the lock.
class ProtectedMemoryLocker {
public:
- ProtectedMemoryLocker(pthread_mutex_t *mutex,
- ProtectedMemoryAllocator *allocator)
+ ProtectedMemoryLocker(pthread_mutex_t* mutex,
+ ProtectedMemoryAllocator* allocator)
: mutex_(mutex),
allocator_(allocator) {
// Lock the mutex
@@ -124,17 +124,17 @@ class ProtectedMemoryLocker {
ProtectedMemoryLocker(const ProtectedMemoryLocker&);
ProtectedMemoryLocker& operator=(const ProtectedMemoryLocker&);
- pthread_mutex_t *mutex_;
- ProtectedMemoryAllocator *allocator_;
+ pthread_mutex_t* mutex_;
+ ProtectedMemoryAllocator* allocator_;
};
//=============================================================================
class Breakpad {
public:
// factory method
- static Breakpad *Create(NSDictionary *parameters) {
+ static Breakpad* Create(NSDictionary* parameters) {
// Allocate from our special allocation pool
- Breakpad *breakpad =
+ Breakpad* breakpad =
new (gBreakpadAllocator->Allocate(sizeof(Breakpad)))
Breakpad();
@@ -152,13 +152,13 @@ class Breakpad {
~Breakpad();
- void SetKeyValue(NSString *key, NSString *value);
- NSString *KeyValue(NSString *key);
- void RemoveKeyValue(NSString *key);
+ void SetKeyValue(NSString* key, NSString* value);
+ NSString* KeyValue(NSString* key);
+ void RemoveKeyValue(NSString* key);
void GenerateAndSendReport();
- void SetFilterCallback(BreakpadFilterCallback callback, void *context) {
+ void SetFilterCallback(BreakpadFilterCallback callback, void* context) {
filter_callback_ = callback;
filter_callback_context_ = context;
}
@@ -173,14 +173,14 @@ class Breakpad {
inspector_path_[0] = 0;
}
- bool Initialize(NSDictionary *parameters);
- bool InitializeInProcess(NSDictionary *parameters);
- bool InitializeOutOfProcess(NSDictionary *parameters);
+ bool Initialize(NSDictionary* parameters);
+ bool InitializeInProcess(NSDictionary* parameters);
+ bool InitializeOutOfProcess(NSDictionary* parameters);
- bool ExtractParameters(NSDictionary *parameters);
+ bool ExtractParameters(NSDictionary* parameters);
// Dispatches to HandleException()
- static bool ExceptionHandlerDirectCallback(void *context,
+ static bool ExceptionHandlerDirectCallback(void* context,
int exception_type,
int exception_code,
int exception_subcode,
@@ -194,28 +194,28 @@ class Breakpad {
// Dispatches to HandleMinidump().
// This gets called instead of ExceptionHandlerDirectCallback when running
// with the BREAKPAD_IN_PROCESS option.
- static bool HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context,
+ static bool HandleMinidumpCallback(const char* dump_dir,
+ const char* minidump_id,
+ void* context,
bool succeeded);
// This is only used when BREAKPAD_IN_PROCESS is YES.
- bool HandleMinidump(const char *dump_dir, const char *minidump_id);
+ bool HandleMinidump(const char* dump_dir, const char* minidump_id);
// Since ExceptionHandler (w/o namespace) is defined as typedef in OSX's
// MachineExceptions.h, we have to explicitly name the handler.
- google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
+ google_breakpad::ExceptionHandler* handler_; // The actual handler (STRONG)
char inspector_path_[PATH_MAX]; // Path to inspector tool
- SimpleStringDictionary *config_params_; // Create parameters (STRONG)
+ SimpleStringDictionary* config_params_; // Create parameters (STRONG)
OnDemandServer inspector_;
bool send_and_exit_; // Exit after sending, if true
BreakpadFilterCallback filter_callback_;
- void *filter_callback_context_;
+ void* filter_callback_context_;
};
#pragma mark -
@@ -227,14 +227,14 @@ class Breakpad {
//=============================================================================
static BOOL IsDebuggerActive() {
BOOL result = NO;
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
+ NSUserDefaults* stdDefaults = [NSUserDefaults standardUserDefaults];
// We check both defaults and the environment variable here
BOOL ignoreDebugger = [stdDefaults boolForKey:@IGNORE_DEBUGGER];
if (!ignoreDebugger) {
- char *ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
+ char* ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
ignoreDebugger = (ignoreDebuggerStr ? strtol(ignoreDebuggerStr, NULL, 10) : 0) != 0;
}
@@ -245,7 +245,7 @@ static BOOL IsDebuggerActive() {
size_t actualSize;
if (sysctl(mib, mibSize, NULL, &actualSize, NULL, 0) == 0) {
- struct kinfo_proc *info = (struct kinfo_proc *)malloc(actualSize);
+ struct kinfo_proc* info = (struct kinfo_proc*)malloc(actualSize);
if (info) {
// This comes from looking at the Darwin xnu Kernel
@@ -261,12 +261,12 @@ static BOOL IsDebuggerActive() {
}
//=============================================================================
-bool Breakpad::ExceptionHandlerDirectCallback(void *context,
- int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread) {
- Breakpad *breakpad = (Breakpad *)context;
+bool Breakpad::ExceptionHandlerDirectCallback(void* context,
+ int exception_type,
+ int exception_code,
+ int exception_subcode,
+ mach_port_t crashing_thread) {
+ Breakpad* breakpad = (Breakpad*)context;
// If our context is damaged or something, just return false to indicate that
// the handler should continue without us.
@@ -280,11 +280,11 @@ bool Breakpad::ExceptionHandlerDirectCallback(void *context,
}
//=============================================================================
-bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context,
+bool Breakpad::HandleMinidumpCallback(const char* dump_dir,
+ const char* minidump_id,
+ void* context,
bool succeeded) {
- Breakpad *breakpad = (Breakpad *)context;
+ Breakpad* breakpad = (Breakpad*)context;
// If our context is damaged or something, just return false to indicate that
// the handler should continue without us.
@@ -307,9 +307,9 @@ bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
// simple non-static C name
//
extern "C" {
-NSString * GetResourcePath();
-NSString * GetResourcePath() {
- NSString *resourcePath = nil;
+NSString* GetResourcePath();
+NSString* GetResourcePath() {
+ NSString* resourcePath = nil;
// If there are multiple breakpads installed then calling bundleWithIdentifier
// will not work properly, so only use that as a backup plan.
@@ -320,17 +320,17 @@ NSString * GetResourcePath() {
// Get the pathname to the code which contains this function
Dl_info info;
if (dladdr((const void*)GetResourcePath, &info) != 0) {
- NSFileManager *filemgr = [NSFileManager defaultManager];
- NSString *filePath =
+ NSFileManager* filemgr = [NSFileManager defaultManager];
+ NSString* filePath =
[filemgr stringWithFileSystemRepresentation:info.dli_fname
length:strlen(info.dli_fname)];
- NSString *bundlePath = [filePath stringByDeletingLastPathComponent];
+ NSString* bundlePath = [filePath stringByDeletingLastPathComponent];
// The "Resources" directory should be in the same directory as the
// executable code, since that's how the Breakpad framework is built.
resourcePath = [bundlePath stringByAppendingPathComponent:@"Resources/"];
} else {
// fallback plan
- NSBundle *bundle =
+ NSBundle* bundle =
[NSBundle bundleWithIdentifier:@"com.Google.BreakpadFramework"];
resourcePath = [bundle resourcePath];
}
@@ -340,7 +340,7 @@ NSString * GetResourcePath() {
} // extern "C"
//=============================================================================
-bool Breakpad::Initialize(NSDictionary *parameters) {
+bool Breakpad::Initialize(NSDictionary* parameters) {
// Initialize
config_params_ = NULL;
handler_ = NULL;
@@ -375,7 +375,7 @@ bool Breakpad::InitializeInProcess(NSDictionary* parameters) {
//=============================================================================
bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
// Get path to Inspector executable.
- NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
+ NSString* inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
// Standardize path (resolve symlinkes, etc.) and escape spaces
inspectorPathString = [inspectorPathString stringByStandardizingPath];
@@ -434,34 +434,34 @@ Breakpad::~Breakpad() {
}
//=============================================================================
-bool Breakpad::ExtractParameters(NSDictionary *parameters) {
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
- NSString *skipConfirm = [stdDefaults stringForKey:@BREAKPAD_SKIP_CONFIRM];
- NSString *sendAndExit = [stdDefaults stringForKey:@BREAKPAD_SEND_AND_EXIT];
-
- NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
- NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
- NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
- NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
- NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL];
- NSString *inspectorPathString =
+bool Breakpad::ExtractParameters(NSDictionary* parameters) {
+ NSUserDefaults* stdDefaults = [NSUserDefaults standardUserDefaults];
+ NSString* skipConfirm = [stdDefaults stringForKey:@BREAKPAD_SKIP_CONFIRM];
+ NSString* sendAndExit = [stdDefaults stringForKey:@BREAKPAD_SEND_AND_EXIT];
+
+ NSString* serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
+ NSString* display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
+ NSString* product = [parameters objectForKey:@BREAKPAD_PRODUCT];
+ NSString* version = [parameters objectForKey:@BREAKPAD_VERSION];
+ NSString* urlStr = [parameters objectForKey:@BREAKPAD_URL];
+ NSString* interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL];
+ NSString* inspectorPathString =
[parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
- NSString *reporterPathString =
+ NSString* reporterPathString =
[parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
- NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT];
- NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES];
- NSString *logFileTailSize =
+ NSString* timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT];
+ NSArray* logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES];
+ NSString* logFileTailSize =
[parameters objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE];
- NSString *requestUserText =
+ NSString* requestUserText =
[parameters objectForKey:@BREAKPAD_REQUEST_COMMENTS];
- NSString *requestEmail = [parameters objectForKey:@BREAKPAD_REQUEST_EMAIL];
- NSString *vendor =
+ NSString* requestEmail = [parameters objectForKey:@BREAKPAD_REQUEST_EMAIL];
+ NSString* vendor =
[parameters objectForKey:@BREAKPAD_VENDOR];
- NSString *dumpSubdirectory =
+ NSString* dumpSubdirectory =
[parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY];
- NSDictionary *serverParameters =
+ NSDictionary* serverParameters =
[parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT];
// These may have been set above as user prefs, which take priority.
@@ -536,7 +536,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
// Find the helper applications if not specified in user config.
- NSString *resourcePath = nil;
+ NSString* resourcePath = nil;
if (!inspectorPathString || !reporterPathString) {
resourcePath = GetResourcePath();
if (!resourcePath) {
@@ -591,7 +591,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
SimpleStringDictionary();
- SimpleStringDictionary &dictionary = *config_params_;
+ SimpleStringDictionary& dictionary = *config_params_;
dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
@@ -633,8 +633,8 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
if (serverParameters) {
// For each key-value pair, call BreakpadAddUploadParameter()
- NSEnumerator *keyEnumerator = [serverParameters keyEnumerator];
- NSString *aParameter;
+ NSEnumerator* keyEnumerator = [serverParameters keyEnumerator];
+ NSString* aParameter;
while ((aParameter = [keyEnumerator nextObject])) {
BreakpadAddUploadParameter(this, aParameter,
[serverParameters objectForKey:aParameter]);
@@ -644,7 +644,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
//=============================================================================
-void Breakpad::SetKeyValue(NSString *key, NSString *value) {
+void Breakpad::SetKeyValue(NSString* key, NSString* value) {
// We allow nil values. This is the same as removing the keyvalue.
if (!config_params_ || !key)
return;
@@ -653,16 +653,16 @@ void Breakpad::SetKeyValue(NSString *key, NSString *value) {
}
//=============================================================================
-NSString *Breakpad::KeyValue(NSString *key) {
+NSString* Breakpad::KeyValue(NSString* key) {
if (!config_params_ || !key)
return nil;
- const char *value = config_params_->GetValueForKey([key UTF8String]);
+ const char* value = config_params_->GetValueForKey([key UTF8String]);
return value ? [NSString stringWithUTF8String:value] : nil;
}
//=============================================================================
-void Breakpad::RemoveKeyValue(NSString *key) {
+void Breakpad::RemoveKeyValue(NSString* key) {
if (!config_params_ || !key) return;
config_params_->RemoveKey([key UTF8String]);
@@ -722,7 +722,7 @@ bool Breakpad::HandleException(int exception_type,
if (result == KERN_SUCCESS) {
// Now, send a series of key-value pairs to the Inspector.
- const SimpleStringDictionary::Entry *entry = NULL;
+ const SimpleStringDictionary::Entry* entry = NULL;
SimpleStringDictionary::Iterator iter(*config_params_);
while ( (entry = iter.Next()) ) {
@@ -759,7 +759,7 @@ bool Breakpad::HandleException(int exception_type,
}
//=============================================================================
-bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) {
+bool Breakpad::HandleMinidump(const char* dump_dir, const char* minidump_id) {
google_breakpad::ConfigFile config_file;
config_file.WriteFile(dump_dir, config_params_, dump_dir, minidump_id);
google_breakpad::LaunchReporter(
@@ -775,7 +775,7 @@ bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) {
#pragma mark Public API
//=============================================================================
-BreakpadRef BreakpadCreate(NSDictionary *parameters) {
+BreakpadRef BreakpadCreate(NSDictionary* parameters) {
try {
// This is confusing. Our two main allocators for breakpad memory are:
// - gKeyValueAllocator for the key/value memory
@@ -815,8 +815,8 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
ProtectedMemoryAllocator(breakpad_pool_size);
// Stack-based autorelease pool for Breakpad::Create() obj-c code.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Breakpad *breakpad = Breakpad::Create(parameters);
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ Breakpad* breakpad = Breakpad::Create(parameters);
if (breakpad) {
// Make read-only to protect against memory smashers
@@ -856,7 +856,7 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
//=============================================================================
void BreakpadRelease(BreakpadRef ref) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (gMasterAllocator) {
gMasterAllocator->Unprotect();
@@ -889,10 +889,10 @@ void BreakpadRelease(BreakpadRef ref) {
}
//=============================================================================
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
+void BreakpadSetKeyValue(BreakpadRef ref, NSString* key, NSString* value) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
@@ -905,20 +905,20 @@ void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
}
void BreakpadAddUploadParameter(BreakpadRef ref,
- NSString *key,
- NSString *value) {
+ NSString* key,
+ NSString* value) {
// The only difference, internally, between an upload parameter and
// a key value one that is set with BreakpadSetKeyValue is that we
// prepend the keyname with a special prefix. This informs the
// crash sender that the parameter should be sent along with the
// POST of the crash dump upload.
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
- NSString *prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
+ NSString* prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
stringByAppendingString:key];
breakpad->SetKeyValue(prefixedKey, value);
}
@@ -928,15 +928,15 @@ void BreakpadAddUploadParameter(BreakpadRef ref,
}
void BreakpadRemoveUploadParameter(BreakpadRef ref,
- NSString *key) {
+ NSString* key) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
- NSString *prefixedKey = [NSString stringWithFormat:@"%@%@",
+ NSString* prefixedKey = [NSString stringWithFormat:@"%@%@",
@BREAKPAD_SERVER_PARAMETER_PREFIX, key];
breakpad->RemoveKeyValue(prefixedKey);
}
@@ -945,12 +945,12 @@ void BreakpadRemoveUploadParameter(BreakpadRef ref,
}
}
//=============================================================================
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
- NSString *value = nil;
+NSString* BreakpadKeyValue(BreakpadRef ref, NSString* key) {
+ NSString* value = nil;
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (!breakpad || !key || !gKeyValueAllocator)
return nil;
@@ -966,10 +966,10 @@ NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
}
//=============================================================================
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
+void BreakpadRemoveKeyValue(BreakpadRef ref, NSString* key) {
try {
// Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && key && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
@@ -984,7 +984,7 @@ void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
//=============================================================================
void BreakpadGenerateAndSendReport(BreakpadRef ref) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && gKeyValueAllocator) {
ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
@@ -1001,10 +1001,10 @@ void BreakpadGenerateAndSendReport(BreakpadRef ref) {
//=============================================================================
void BreakpadSetFilterCallback(BreakpadRef ref,
BreakpadFilterCallback callback,
- void *context) {
+ void* context) {
try {
- Breakpad *breakpad = (Breakpad *)ref;
+ Breakpad* breakpad = (Breakpad*)ref;
if (breakpad && gBreakpadAllocator) {
// share the dictionary mutex here (we really don't need a mutex)
@@ -1018,14 +1018,14 @@ void BreakpadSetFilterCallback(BreakpadRef ref,
}
//============================================================================
-void BreakpadAddLogFile(BreakpadRef ref, NSString *logPathname) {
+void BreakpadAddLogFile(BreakpadRef ref, NSString* logPathname) {
int logFileCounter = 0;
- NSString *logFileKey = [NSString stringWithFormat:@"%@%d",
+ NSString* logFileKey = [NSString stringWithFormat:@"%@%d",
@BREAKPAD_LOGFILE_KEY_PREFIX,
logFileCounter];
- NSString *existingLogFilename = nil;
+ NSString* existingLogFilename = nil;
existingLogFilename = BreakpadKeyValue(ref, logFileKey);
// Find the first log file key that we can use by testing for existence
while (existingLogFilename) {
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.h b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.h
index d4db5d3acf3..be0d2b79a83 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.h
@@ -41,7 +41,7 @@
// Example Usage :
//
// kern_return_t result;
-// OnDemandServer *server = OnDemandServer::Create("/tmp/myserver",
+// OnDemandServer* server = OnDemandServer::Create("/tmp/myserver",
// "com.MyCompany.MyServiceName",
// true,
// &result);
@@ -88,8 +88,8 @@ class OnDemandServer {
}
// Creates the bootstrap server and service
- kern_return_t Initialize(const char *server_command,
- const char *service_name,
+ kern_return_t Initialize(const char* server_command,
+ const char* service_name,
bool unregister_on_cleanup);
// Returns an OnDemandServer object if successful, or NULL if there's
@@ -110,10 +110,10 @@ class OnDemandServer {
// out_result : if non-NULL, returns the result
// this value will be KERN_SUCCESS if Create() returns non-NULL
//
- static OnDemandServer *Create(const char *server_command,
- const char *service_name,
+ static OnDemandServer* Create(const char *server_command,
+ const char* service_name,
bool unregister_on_cleanup,
- kern_return_t *out_result);
+ kern_return_t* out_result);
// Cleans up and if LaunchOnDemand() has not yet been called then
// the bootstrap service will be unregistered.
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.mm b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.mm
index a2ffa43473b..b6b59ca5a69 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/Framework/OnDemandServer.mm
@@ -49,11 +49,11 @@
#endif
//==============================================================================
-OnDemandServer *OnDemandServer::Create(const char *server_command,
- const char *service_name,
+OnDemandServer* OnDemandServer::Create(const char* server_command,
+ const char* service_name,
bool unregister_on_cleanup,
- kern_return_t *out_result) {
- OnDemandServer *server = new OnDemandServer();
+ kern_return_t* out_result) {
+ OnDemandServer* server = new OnDemandServer();
if (!server) return NULL;
@@ -74,8 +74,8 @@ OnDemandServer *OnDemandServer::Create(const char *server_command,
}
//==============================================================================
-kern_return_t OnDemandServer::Initialize(const char *server_command,
- const char *service_name,
+kern_return_t OnDemandServer::Initialize(const char* server_command,
+ const char* service_name,
bool unregister_on_cleanup) {
unregister_on_cleanup_ = unregister_on_cleanup;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.h b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.h
index f2da7c24afb..11bc2e4345d 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.h
@@ -35,7 +35,7 @@
namespace google_breakpad {
-BOOL EnsureDirectoryPathExists(NSString *dirPath);
+BOOL EnsureDirectoryPathExists(NSString* dirPath);
//=============================================================================
class ConfigFile {
@@ -50,11 +50,11 @@ class ConfigFile {
}
void WriteFile(const char* directory,
- const SimpleStringDictionary *configurationParameters,
- const char *dump_dir,
- const char *minidump_id);
+ const SimpleStringDictionary* configurationParameters,
+ const char* dump_dir,
+ const char* minidump_id);
- const char *GetFilePath() { return config_file_path_; }
+ const char* GetFilePath() { return config_file_path_; }
void Unlink() {
if (config_file_ != -1)
@@ -64,16 +64,16 @@ class ConfigFile {
}
private:
- BOOL WriteData(const void *data, size_t length);
+ BOOL WriteData(const void* data, size_t length);
- BOOL AppendConfigData(const char *key,
- const void *data,
+ BOOL AppendConfigData(const char* key,
+ const void* data,
size_t length);
- BOOL AppendConfigString(const char *key,
- const char *value);
+ BOOL AppendConfigString(const char* key,
+ const char* value);
- BOOL AppendCrashTimeParameters(const char *processStartTimeString);
+ BOOL AppendCrashTimeParameters(const char* processStartTimeString);
int config_file_; // descriptor for config file
char config_file_path_[PATH_MAX]; // Path to configuration file
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm
index acab7de84cc..57d07590a27 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/ConfigFile.mm
@@ -42,10 +42,10 @@
namespace google_breakpad {
//=============================================================================
-BOOL EnsureDirectoryPathExists(NSString *dirPath) {
- NSFileManager *mgr = [NSFileManager defaultManager];
+BOOL EnsureDirectoryPathExists(NSString* dirPath) {
+ NSFileManager* mgr = [NSFileManager defaultManager];
- NSDictionary *attrs =
+ NSDictionary* attrs =
[NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:0750]
forKey:NSFilePosixPermissions];
@@ -56,15 +56,15 @@ BOOL EnsureDirectoryPathExists(NSString *dirPath) {
}
//=============================================================================
-BOOL ConfigFile::WriteData(const void *data, size_t length) {
+BOOL ConfigFile::WriteData(const void* data, size_t length) {
size_t result = write(config_file_, data, length);
return result == length;
}
//=============================================================================
-BOOL ConfigFile::AppendConfigData(const char *key,
- const void *data, size_t length) {
+BOOL ConfigFile::AppendConfigData(const char* key,
+ const void* data, size_t length) {
assert(config_file_ != -1);
if (!key) {
@@ -88,13 +88,13 @@ BOOL ConfigFile::AppendConfigData(const char *key,
}
//=============================================================================
-BOOL ConfigFile::AppendConfigString(const char *key,
- const char *value) {
+BOOL ConfigFile::AppendConfigString(const char* key,
+ const char* value) {
return AppendConfigData(key, value, strlen(value));
}
//=============================================================================
-BOOL ConfigFile::AppendCrashTimeParameters(const char *processStartTimeString) {
+BOOL ConfigFile::AppendCrashTimeParameters(const char* processStartTimeString) {
// Set process uptime parameter
struct timeval tv;
gettimeofday(&tv, NULL);
@@ -118,9 +118,9 @@ BOOL ConfigFile::AppendCrashTimeParameters(const char *processStartTimeString) {
//=============================================================================
void ConfigFile::WriteFile(const char* directory,
- const SimpleStringDictionary *configurationParameters,
- const char *dump_dir,
- const char *minidump_id) {
+ const SimpleStringDictionary* configurationParameters,
+ const char* dump_dir,
+ const char* minidump_id) {
assert(config_file_ == -1);
@@ -146,9 +146,9 @@ void ConfigFile::WriteFile(const char* directory,
// Write out the configuration parameters
BOOL result = YES;
- const SimpleStringDictionary &dictionary = *configurationParameters;
+ const SimpleStringDictionary& dictionary = *configurationParameters;
- const SimpleStringDictionary::Entry *entry = NULL;
+ const SimpleStringDictionary::Entry* entry = NULL;
SimpleStringDictionary::Iterator iter(dictionary);
while ((entry = iter.Next())) {
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.h b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.h
index 7f923ed614f..c967113638f 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.h
@@ -63,7 +63,7 @@ struct KeyValueMessageData {
public:
KeyValueMessageData() {}
explicit KeyValueMessageData(
- const google_breakpad::SimpleStringDictionary::Entry &inEntry) {
+ const google_breakpad::SimpleStringDictionary::Entry& inEntry) {
strlcpy(key, inEntry.key, sizeof(key) );
strlcpy(value, inEntry.value, sizeof(value) );
}
@@ -80,7 +80,7 @@ namespace google_breakpad {
//=============================================================================
class MinidumpLocation {
public:
- MinidumpLocation(NSString *minidumpDir) {
+ MinidumpLocation(NSString* minidumpDir) {
// Ensure that the path exists. Fallback to /tmp if unable to locate path.
assert(minidumpDir);
if (!EnsureDirectoryPathExists(minidumpDir)) {
@@ -100,8 +100,8 @@ class MinidumpLocation {
strlcpy(minidump_id_, next_minidump_id.c_str(), sizeof(minidump_id_));
}
- const char *GetPath() { return minidump_dir_path_; }
- const char *GetID() { return minidump_id_; }
+ const char* GetPath() { return minidump_dir_path_; }
+ const char* GetID() { return minidump_id_; }
private:
char minidump_dir_path_[PATH_MAX]; // Path to minidump directory
@@ -116,7 +116,7 @@ class Inspector {
// given a bootstrap service name, receives mach messages
// from a crashed process, then inspects it, creates a minidump file
// and asks the user if he wants to upload it to a server.
- void Inspect(const char *receive_port_name);
+ void Inspect(const char* receive_port_name);
private:
// The Inspector is invoked with its bootstrap port set to the bootstrap
@@ -131,8 +131,8 @@ class Inspector {
// ServiceCheckOut.
kern_return_t ResetBootstrapPort();
- kern_return_t ServiceCheckIn(const char *receive_port_name);
- kern_return_t ServiceCheckOut(const char *receive_port_name);
+ kern_return_t ServiceCheckIn(const char* receive_port_name);
+ kern_return_t ServiceCheckOut(const char* receive_port_name);
kern_return_t ReadMessages();
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.mm b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.mm
index dc6f48086de..d5fc29e026a 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.mm
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/Inspector.mm
@@ -52,7 +52,7 @@
namespace google_breakpad {
//=============================================================================
-void Inspector::Inspect(const char *receive_port_name) {
+void Inspector::Inspect(const char* receive_port_name) {
kern_return_t result = ResetBootstrapPort();
if (result != KERN_SUCCESS) {
return;
@@ -143,7 +143,7 @@ kern_return_t Inspector::ResetBootstrapPort() {
}
//=============================================================================
-kern_return_t Inspector::ServiceCheckIn(const char *receive_port_name) {
+kern_return_t Inspector::ServiceCheckIn(const char* receive_port_name) {
// We need to get the mach port representing this service, so we can
// get information from the crashed process.
kern_return_t kr = bootstrap_check_in(bootstrap_subset_port_,
@@ -160,7 +160,7 @@ kern_return_t Inspector::ServiceCheckIn(const char *receive_port_name) {
}
//=============================================================================
-kern_return_t Inspector::ServiceCheckOut(const char *receive_port_name) {
+kern_return_t Inspector::ServiceCheckOut(const char* receive_port_name) {
// We're done receiving mach messages from the crashed process,
// so clean up a bit.
kern_return_t kr;
@@ -198,7 +198,7 @@ kern_return_t Inspector::ReadMessages() {
kern_return_t result = receive_port.WaitForMessage(&message, 1000);
if (result == KERN_SUCCESS) {
- InspectorInfo &info = (InspectorInfo &)*message.GetData();
+ InspectorInfo& info = (InspectorInfo&)*message.GetData();
exception_type_ = info.exception_type;
exception_code_ = info.exception_code;
exception_subcode_ = info.exception_subcode;
@@ -237,7 +237,7 @@ kern_return_t Inspector::ReadMessages() {
result = receive_port.WaitForMessage(&parameter_message, 1000);
if(result == KERN_SUCCESS) {
- KeyValueMessageData &key_value_data =
+ KeyValueMessageData& key_value_data =
(KeyValueMessageData&)*parameter_message.GetData();
// If we get a blank key, make sure we don't increment the
// parameter count; in some cases (notably on-demand generation
@@ -267,27 +267,27 @@ bool Inspector::InspectTask() {
// keep the task quiet while we're looking at it
task_suspend(remote_task_);
- NSString *minidumpDir;
+ NSString* minidumpDir;
- const char *minidumpDirectory =
+ const char* minidumpDirectory =
config_params_.GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
// If the client app has not specified a minidump directory,
// use a default of Library/<kDefaultLibrarySubdirectory>/<Product Name>
if (!minidumpDirectory || 0 == strlen(minidumpDirectory)) {
- NSArray *libraryDirectories =
+ NSArray* libraryDirectories =
NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask,
YES);
- NSString *applicationSupportDirectory =
+ NSString* applicationSupportDirectory =
[libraryDirectories objectAtIndex:0];
- NSString *library_subdirectory = [NSString
+ NSString* library_subdirectory = [NSString
stringWithUTF8String:kDefaultLibrarySubdirectory];
- NSString *breakpad_product = [NSString
+ NSString* breakpad_product = [NSString
stringWithUTF8String:config_params_.GetValueForKey(BREAKPAD_PRODUCT)];
- NSArray *path_components = [NSArray
+ NSArray* path_components = [NSArray
arrayWithObjects:applicationSupportDirectory,
library_subdirectory,
breakpad_product,
@@ -306,11 +306,11 @@ bool Inspector::InspectTask() {
// assumes system encoding and in RTL locales will prepend an LTR override
// character for paths beginning with '/' which fileSystemRepresentation does
// not remove. Filed as rdar://6889706 .
- NSString *path_ns = [NSString
+ NSString* path_ns = [NSString
stringWithUTF8String:minidumpLocation.GetPath()];
- NSString *pathid_ns = [NSString
+ NSString* pathid_ns = [NSString
stringWithUTF8String:minidumpLocation.GetID()];
- NSString *minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns];
+ NSString* minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns];
minidumpPath = [minidumpPath
stringByAppendingPathExtension:@"dmp"];
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.cc
index 451e8d9c2a7..ae44e8bf892 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.cc
@@ -38,15 +38,15 @@
namespace google_breakpad {
CrashGenerationServer::CrashGenerationServer(
- const char *mach_port_name,
+ const char* mach_port_name,
FilterCallback filter,
- void *filter_context,
+ void* filter_context,
OnClientDumpRequestCallback dump_callback,
- void *dump_context,
+ void* dump_context,
OnClientExitingCallback exit_callback,
- void *exit_context,
+ void* exit_context,
bool generate_dumps,
- const std::string &dump_path)
+ const std::string& dump_path)
: filter_(filter),
filter_context_(filter_context),
dump_callback_(dump_callback),
@@ -90,8 +90,8 @@ bool CrashGenerationServer::Stop() {
}
// static
-void *CrashGenerationServer::WaitForMessages(void *server) {
- CrashGenerationServer *self =
+void* CrashGenerationServer::WaitForMessages(void* server) {
+ CrashGenerationServer* self =
reinterpret_cast<CrashGenerationServer*>(server);
while (self->WaitForOneMessage()) {}
return NULL;
@@ -104,7 +104,7 @@ bool CrashGenerationServer::WaitForOneMessage() {
if (result == KERN_SUCCESS) {
switch (message.GetMessageID()) {
case kDumpRequestMessage: {
- ExceptionInfo &info = (ExceptionInfo &)*message.GetData();
+ ExceptionInfo& info = (ExceptionInfo&)*message.GetData();
mach_port_t remote_task = message.GetTranslatedPort(0);
mach_port_t crashing_thread = message.GetTranslatedPort(1);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.h b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.h
index 85bd5b5e33e..82fef146e76 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/crash_generation/crash_generation_server.h
@@ -59,14 +59,14 @@ class CrashGenerationServer {
// WARNING: callbacks may be invoked on a different thread
// than that which creates the CrashGenerationServer. They must
// be thread safe.
- typedef void (*OnClientDumpRequestCallback)(void *context,
- const ClientInfo &client_info,
- const std::string &file_path);
+ typedef void (*OnClientDumpRequestCallback)(void* context,
+ const ClientInfo& client_info,
+ const std::string& file_path);
- typedef void (*OnClientExitingCallback)(void *context,
- const ClientInfo &client_info);
+ typedef void (*OnClientExitingCallback)(void* context,
+ const ClientInfo& client_info);
// If a FilterCallback returns false, the dump will not be written.
- typedef bool (*FilterCallback)(void *context);
+ typedef bool (*FilterCallback)(void* context);
// Create an instance with the given parameters.
//
@@ -83,15 +83,15 @@ class CrashGenerationServer {
// passed for this parameter.
// dump_path: Path for generating dumps; required only if true is
// passed for generateDumps parameter; NULL can be passed otherwise.
- CrashGenerationServer(const char *mach_port_name,
+ CrashGenerationServer(const char* mach_port_name,
FilterCallback filter,
- void *filter_context,
+ void* filter_context,
OnClientDumpRequestCallback dump_callback,
- void *dump_context,
+ void* dump_context,
OnClientExitingCallback exit_callback,
- void *exit_context,
+ void* exit_context,
bool generate_dumps,
- const std::string &dump_path);
+ const std::string& dump_path);
~CrashGenerationServer();
@@ -105,24 +105,24 @@ class CrashGenerationServer {
private:
// Return a unique filename at which a minidump can be written.
- bool MakeMinidumpFilename(std::string &outFilename);
+ bool MakeMinidumpFilename(std::string& outFilename);
// Loop reading client messages and responding to them until
// a quit message is received.
- static void *WaitForMessages(void *server);
+ static void* WaitForMessages(void* server);
// Wait for a single client message and respond to it. Returns false
// if a quit message was received or if an error occurred.
bool WaitForOneMessage();
FilterCallback filter_;
- void *filter_context_;
+ void* filter_context_;
OnClientDumpRequestCallback dump_callback_;
- void *dump_context_;
+ void* dump_context_;
OnClientExitingCallback exit_callback_;
- void *exit_context_;
+ void* exit_context_;
bool generate_dumps_;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.cc
index 3492b823dad..b4f04c91727 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.cc
@@ -131,7 +131,7 @@ struct MachBits<nlist64> {
template<typename nlist_type>
int
-__breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
+__breakpad_fdnlist(int fd, nlist_type* list, const char** symbolNames,
cpu_type_t cpu_type);
/*
@@ -139,9 +139,9 @@ __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
*/
template <typename nlist_type>
-int breakpad_nlist_common(const char *name,
- nlist_type *list,
- const char **symbolNames,
+int breakpad_nlist_common(const char* name,
+ nlist_type* list,
+ const char** symbolNames,
cpu_type_t cpu_type) {
int fd = open(name, O_RDONLY, 0);
if (fd < 0)
@@ -151,16 +151,16 @@ int breakpad_nlist_common(const char *name,
return n;
}
-int breakpad_nlist(const char *name,
- struct nlist *list,
- const char **symbolNames,
+int breakpad_nlist(const char* name,
+ struct nlist* list,
+ const char** symbolNames,
cpu_type_t cpu_type) {
return breakpad_nlist_common(name, list, symbolNames, cpu_type);
}
-int breakpad_nlist(const char *name,
- struct nlist_64 *list,
- const char **symbolNames,
+int breakpad_nlist(const char* name,
+ struct nlist_64* list,
+ const char** symbolNames,
cpu_type_t cpu_type) {
return breakpad_nlist_common(name, list, symbolNames, cpu_type);
}
@@ -168,7 +168,7 @@ int breakpad_nlist(const char *name,
/* Note: __fdnlist() is called from kvm_nlist in libkvm's kvm.c */
template<typename nlist_type>
-int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
+int __breakpad_fdnlist(int fd, nlist_type* list, const char** symbolNames,
cpu_type_t cpu_type) {
typedef typename MachBits<nlist_type>::mach_header_type mach_header_type;
typedef typename MachBits<nlist_type>::word_type word_type;
@@ -189,9 +189,9 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
}
struct exec buf;
- if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) ||
- (N_BADMAG(buf) && *((uint32_t *)&buf) != magic &&
- CFSwapInt32BigToHost(*((uint32_t *)&buf)) != FAT_MAGIC &&
+ if (read(fd, (char*)&buf, sizeof(buf)) != sizeof(buf) ||
+ (N_BADMAG(buf) && *((uint32_t*)&buf) != magic &&
+ CFSwapInt32BigToHost(*((uint32_t*)&buf)) != FAT_MAGIC &&
/* The following is the big-endian ppc64 check */
(*((uint32_t*)&buf)) != FAT_MAGIC)) {
return -1;
@@ -199,15 +199,15 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
/* Deal with fat file if necessary */
unsigned arch_offset = 0;
- if (CFSwapInt32BigToHost(*((uint32_t *)&buf)) == FAT_MAGIC ||
+ if (CFSwapInt32BigToHost(*((uint32_t*)&buf)) == FAT_MAGIC ||
/* The following is the big-endian ppc64 check */
- *((unsigned int *)&buf) == FAT_MAGIC) {
+ *((unsigned int*)&buf) == FAT_MAGIC) {
/* Read in the fat header */
struct fat_header fh;
if (lseek(fd, 0, SEEK_SET) == -1) {
return -1;
}
- if (read(fd, (char *)&fh, sizeof(fh)) != sizeof(fh)) {
+ if (read(fd, (char*)&fh, sizeof(fh)) != sizeof(fh)) {
return -1;
}
@@ -215,12 +215,12 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
fh.nfat_arch = CFSwapInt32BigToHost(fh.nfat_arch);
/* Read in the fat archs */
- struct fat_arch *fat_archs =
- (struct fat_arch *)malloc(fh.nfat_arch * sizeof(struct fat_arch));
+ struct fat_arch* fat_archs =
+ (struct fat_arch*)malloc(fh.nfat_arch * sizeof(struct fat_arch));
if (fat_archs == NULL) {
return -1;
}
- if (read(fd, (char *)fat_archs,
+ if (read(fd, (char*)fat_archs,
sizeof(struct fat_arch) * fh.nfat_arch) !=
(ssize_t)(sizeof(struct fat_arch) * fh.nfat_arch)) {
free(fat_archs);
@@ -244,7 +244,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
CFSwapInt32BigToHost(fat_archs[i].align);
}
- struct fat_arch *fap = NULL;
+ struct fat_arch* fap = NULL;
for (unsigned i = 0; i < fh.nfat_arch; i++) {
if (fat_archs[i].cputype == cpu_type) {
fap = &fat_archs[i];
@@ -263,7 +263,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
if (lseek(fd, arch_offset, SEEK_SET) == -1) {
return -1;
}
- if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf)) {
+ if (read(fd, (char*)&buf, sizeof(buf)) != sizeof(buf)) {
return -1;
}
}
@@ -271,48 +271,45 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
off_t sa; /* symbol address */
off_t ss; /* start of strings */
register_t n;
- if (*((unsigned int *)&buf) == magic) {
+ if (*((unsigned int*)&buf) == magic) {
if (lseek(fd, arch_offset, SEEK_SET) == -1) {
return -1;
}
mach_header_type mh;
- if (read(fd, (char *)&mh, sizeof(mh)) != sizeof(mh)) {
+ if (read(fd, (char*)&mh, sizeof(mh)) != sizeof(mh)) {
return -1;
}
- struct load_command *load_commands =
- (struct load_command *)malloc(mh.sizeofcmds);
+ struct load_command* load_commands =
+ (struct load_command*)malloc(mh.sizeofcmds);
if (load_commands == NULL) {
return -1;
}
- if (read(fd, (char *)load_commands, mh.sizeofcmds) !=
+ if (read(fd, (char*)load_commands, mh.sizeofcmds) !=
(ssize_t)mh.sizeofcmds) {
free(load_commands);
return -1;
}
- struct symtab_command *stp = NULL;
- struct load_command *lcp = load_commands;
+ struct symtab_command* stp = NULL;
+ struct load_command* lcp = load_commands;
// iterate through all load commands, looking for
// LC_SYMTAB load command
for (uint32_t i = 0; i < mh.ncmds; i++) {
if (lcp->cmdsize % sizeof(word_type) != 0 ||
lcp->cmdsize <= 0 ||
- (char *)lcp + lcp->cmdsize >
- (char *)load_commands + mh.sizeofcmds) {
+ (char*)lcp + lcp->cmdsize > (char*)load_commands + mh.sizeofcmds) {
free(load_commands);
return -1;
}
if (lcp->cmd == LC_SYMTAB) {
- if (lcp->cmdsize !=
- sizeof(struct symtab_command)) {
+ if (lcp->cmdsize != sizeof(struct symtab_command)) {
free(load_commands);
return -1;
}
- stp = (struct symtab_command *)lcp;
+ stp = (struct symtab_command*)lcp;
break;
}
- lcp = (struct load_command *)
- ((char *)lcp + lcp->cmdsize);
+ lcp = (struct load_command*)((char*)lcp + lcp->cmdsize);
}
if (stp == NULL) {
free(load_commands);
@@ -347,7 +344,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
if (n < m)
m = n;
- if (read(fd, (char *)space, m) != m)
+ if (read(fd, (char*)space, m) != m)
break;
n -= m;
off_t savpos = lseek(fd, 0, SEEK_CUR);
@@ -368,13 +365,13 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
if (read(fd, nambuf, maxlen+1) == -1) {
return -1;
}
- const char *s2 = nambuf;
- for (nlist_type *p = list;
+ const char* s2 = nambuf;
+ for (nlist_type* p = list;
symbolNames[p-list] && symbolNames[p-list][0];
p++) {
// get the symbol name the user has passed in that
// corresponds to the nlist entry that we're looking at
- const char *s1 = symbolNames[p - list];
+ const char* s1 = symbolNames[p - list];
while (*s1) {
if (*s1++ != *s2++)
goto cont;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.h b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.h
index e8e2e0834e6..a1a3e83c96e 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/breakpad_nlist_64.h
@@ -36,13 +36,13 @@
#include <mach/machine.h>
-int breakpad_nlist(const char *name,
- struct nlist *list,
- const char **symbolNames,
+int breakpad_nlist(const char* name,
+ struct nlist* list,
+ const char** symbolNames,
cpu_type_t cpu_type);
-int breakpad_nlist(const char *name,
- struct nlist_64 *list,
- const char **symbolNames,
+int breakpad_nlist(const char* name,
+ struct nlist_64* list,
+ const char** symbolNames,
cpu_type_t cpu_type);
#endif /* CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ */
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.cc
index cdba6df4acf..b78c2087775 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.cc
@@ -66,7 +66,7 @@ struct task_dyld_info {
mach_vm_size_t all_image_info_size;
};
typedef struct task_dyld_info task_dyld_info_data_t;
-typedef struct task_dyld_info *task_dyld_info_t;
+typedef struct task_dyld_info* task_dyld_info_t;
#define TASK_DYLD_INFO_COUNT (sizeof(task_dyld_info_data_t) / sizeof(natural_t))
#endif
@@ -88,7 +88,7 @@ using std::vector;
//
static mach_vm_size_t GetMemoryRegionSize(task_port_t target_task,
const uint64_t address,
- mach_vm_size_t *size_to_end) {
+ mach_vm_size_t* size_to_end) {
mach_vm_address_t region_base = (mach_vm_address_t)address;
mach_vm_size_t region_size;
natural_t nesting_level = 0;
@@ -182,7 +182,7 @@ static string ReadTaskString(task_port_t target_task,
kern_return_t ReadTaskMemory(task_port_t target_task,
const uint64_t address,
size_t length,
- vector<uint8_t> &bytes) {
+ vector<uint8_t>& bytes) {
int systemPageSize = getpagesize();
// use the negative of the page size for the mask to find the page address
@@ -250,16 +250,16 @@ bool FindTextSection(DynamicImage& image) {
return false;
}
- const struct load_command *cmd =
- reinterpret_cast<const struct load_command *>(header + 1);
+ const struct load_command* cmd =
+ reinterpret_cast<const struct load_command*>(header + 1);
bool found_text_section = false;
bool found_dylib_id_command = false;
for (unsigned int i = 0; cmd && (i < header->ncmds); ++i) {
if (!found_text_section) {
if (cmd->cmd == MachBits::segment_load_command) {
- const mach_segment_command_type *seg =
- reinterpret_cast<const mach_segment_command_type *>(cmd);
+ const mach_segment_command_type* seg =
+ reinterpret_cast<const mach_segment_command_type*>(cmd);
if (!strcmp(seg->segname, "__TEXT")) {
image.vmaddr_ = static_cast<mach_vm_address_t>(seg->vmaddr);
@@ -277,8 +277,8 @@ bool FindTextSection(DynamicImage& image) {
if (!found_dylib_id_command) {
if (cmd->cmd == LC_ID_DYLIB) {
- const struct dylib_command *dc =
- reinterpret_cast<const struct dylib_command *>(cmd);
+ const struct dylib_command* dc =
+ reinterpret_cast<const struct dylib_command*>(cmd);
image.version_ = dc->dylib.current_version;
found_dylib_id_command = true;
@@ -289,8 +289,8 @@ bool FindTextSection(DynamicImage& image) {
return true;
}
- cmd = reinterpret_cast<const struct load_command *>
- (reinterpret_cast<const char *>(cmd) + cmd->cmdsize);
+ cmd = reinterpret_cast<const struct load_command*>
+ (reinterpret_cast<const char*>(cmd) + cmd->cmdsize);
}
return false;
@@ -349,8 +349,8 @@ static uint64_t LookupSymbol(const char* symbol_name,
typedef typename MachBits::nlist_type nlist_type;
nlist_type symbol_info[8] = {};
- const char *symbolNames[2] = { symbol_name, "\0" };
- nlist_type &list = symbol_info[0];
+ const char* symbolNames[2] = { symbol_name, "\0" };
+ nlist_type& list = symbol_info[0];
int invalidEntriesCount = breakpad_nlist(filename,
&list,
symbolNames,
@@ -396,8 +396,8 @@ uint64_t DynamicImages::GetDyldAllImageInfosPointer() {
return (uint64_t)task_dyld_info.all_image_info_addr;
} else {
- const char *imageSymbolName = "_dyld_all_image_infos";
- const char *dyldPath = "/usr/lib/dyld";
+ const char* imageSymbolName = "_dyld_all_image_infos";
+ const char* dyldPath = "/usr/lib/dyld";
if (Is64Bit())
return LookupSymbol<MachO64>(imageSymbolName, dyldPath, cpu_type_);
@@ -428,7 +428,7 @@ void ReadImageInfo(DynamicImages& images,
dyld_all_info_bytes) != KERN_SUCCESS)
return;
- dyld_all_image_infos *dyldInfo =
+ dyld_all_image_infos* dyldInfo =
reinterpret_cast<dyld_all_image_infos*>(&dyld_all_info_bytes[0]);
// number of loaded images
@@ -443,12 +443,12 @@ void ReadImageInfo(DynamicImages& images,
dyld_info_array_bytes) != KERN_SUCCESS)
return;
- dyld_image_info *infoArray =
+ dyld_image_info* infoArray =
reinterpret_cast<dyld_image_info*>(&dyld_info_array_bytes[0]);
images.image_list_.reserve(count);
for (int i = 0; i < count; ++i) {
- dyld_image_info &info = infoArray[i];
+ dyld_image_info& info = infoArray[i];
// First read just the mach_header from the image in the task.
vector<uint8_t> mach_header_bytes;
@@ -458,7 +458,7 @@ void ReadImageInfo(DynamicImages& images,
mach_header_bytes) != KERN_SUCCESS)
continue; // bail on this dynamic image
- mach_header_type *header =
+ mach_header_type* header =
reinterpret_cast<mach_header_type*>(&mach_header_bytes[0]);
// Now determine the total amount necessary to read the header
@@ -482,7 +482,7 @@ void ReadImageInfo(DynamicImages& images,
}
// Create an object representing this image and add it to our list.
- DynamicImage *new_image;
+ DynamicImage* new_image;
new_image = new DynamicImage(&mach_header_bytes[0],
header_size,
info.load_address_,
@@ -522,7 +522,7 @@ void DynamicImages::ReadImageInfoForTask() {
}
//==============================================================================
-DynamicImage *DynamicImages::GetExecutableImage() {
+DynamicImage* DynamicImages::GetExecutableImage() {
int executable_index = GetExecutableImageIndex();
if (executable_index >= 0) {
@@ -538,7 +538,7 @@ int DynamicImages::GetExecutableImageIndex() {
int image_count = GetImageCount();
for (int i = 0; i < image_count; ++i) {
- DynamicImage *image = GetImage(i);
+ DynamicImage* image = GetImage(i);
if (image->GetFileType() == MH_EXECUTE) {
return i;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.h b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.h
index 65147900b82..e81ea7f3a06 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/dynamic_images.h
@@ -108,7 +108,7 @@ uint32_t GetFileTypeFromHeader(DynamicImage& image);
// Represents a single dynamically loaded mach-o image
class DynamicImage {
public:
- DynamicImage(uint8_t *header, // data is copied
+ DynamicImage(uint8_t* header, // data is copied
size_t header_size, // includes load commands
uint64_t load_address,
string file_path,
@@ -163,7 +163,7 @@ class DynamicImage {
uint32_t GetVersion() {return version_;}
// For sorting
- bool operator<(const DynamicImage &inInfo) {
+ bool operator<(const DynamicImage& inInfo) {
return GetLoadAddress() < inInfo.GetLoadAddress();
}
@@ -171,8 +171,8 @@ class DynamicImage {
bool IsValid() {return GetVMSize() != 0;}
private:
- DynamicImage(const DynamicImage &);
- DynamicImage &operator=(const DynamicImage &);
+ DynamicImage(const DynamicImage&);
+ DynamicImage& operator=(const DynamicImage&);
friend class DynamicImages;
template<typename MachBits>
@@ -205,26 +205,26 @@ class DynamicImage {
//
class DynamicImageRef {
public:
- explicit DynamicImageRef(DynamicImage *inP) : p(inP) {}
+ explicit DynamicImageRef(DynamicImage* inP) : p(inP) {}
// The copy constructor is required by STL
- DynamicImageRef(const DynamicImageRef &inRef) : p(inRef.p) {}
+ DynamicImageRef(const DynamicImageRef& inRef) : p(inRef.p) {}
- bool operator<(const DynamicImageRef &inRef) const {
+ bool operator<(const DynamicImageRef& inRef) const {
return (*const_cast<DynamicImageRef*>(this)->p)
< (*const_cast<DynamicImageRef&>(inRef).p);
}
- bool operator==(const DynamicImageRef &inInfo) const {
+ bool operator==(const DynamicImageRef& inInfo) const {
return (*const_cast<DynamicImageRef*>(this)->p).GetLoadAddress() ==
(*const_cast<DynamicImageRef&>(inInfo)).GetLoadAddress();
}
// Be just like DynamicImage*
- DynamicImage *operator->() {return p;}
+ DynamicImage* operator->() {return p;}
operator DynamicImage*() {return p;}
private:
- DynamicImage *p;
+ DynamicImage* p;
};
// Helper function to deal with 32-bit/64-bit Mach-O differences.
@@ -250,7 +250,7 @@ class DynamicImages {
int GetImageCount() const {return static_cast<int>(image_list_.size());}
// Returns an individual image.
- DynamicImage *GetImage(int i) {
+ DynamicImage* GetImage(int i) {
if (i < (int)image_list_.size()) {
return image_list_[i];
}
@@ -258,7 +258,7 @@ class DynamicImages {
}
// Returns the image corresponding to the main executable.
- DynamicImage *GetExecutableImage();
+ DynamicImage* GetExecutableImage();
int GetExecutableImageIndex();
// Returns the task which we're looking at.
@@ -312,7 +312,7 @@ class DynamicImages {
kern_return_t ReadTaskMemory(task_port_t target_task,
const uint64_t address,
size_t length,
- vector<uint8_t> &bytes);
+ vector<uint8_t>& bytes);
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.cc
index 2a19d46a940..287fe1bec55 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.cc
@@ -220,7 +220,7 @@ kern_return_t catch_exception_raise(mach_port_t port, mach_port_t failed_thread,
}
#endif
-ExceptionHandler::ExceptionHandler(const string &dump_path,
+ExceptionHandler::ExceptionHandler(const string& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
@@ -304,7 +304,7 @@ bool ExceptionHandler::WriteMinidump(bool write_exception_stream) {
}
// static
-bool ExceptionHandler::WriteMinidump(const string &dump_path,
+bool ExceptionHandler::WriteMinidump(const string& dump_path,
bool write_exception_stream,
MinidumpCallback callback,
void* callback_context) {
@@ -316,7 +316,7 @@ bool ExceptionHandler::WriteMinidump(const string &dump_path,
// static
bool ExceptionHandler::WriteMinidumpForChild(mach_port_t child,
mach_port_t child_blamed_thread,
- const string &dump_path,
+ const string& dump_path,
MinidumpCallback callback,
void* callback_context) {
ScopedTaskSuspend suspend(child);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.h b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.h
index f1d9ae92dee..fe7491fd4cf 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/exception_handler.h
@@ -75,7 +75,7 @@ class ExceptionHandler {
// 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);
+ 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
@@ -85,18 +85,18 @@ class ExceptionHandler {
// 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);
+ 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);
+ 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
@@ -106,22 +106,22 @@ class ExceptionHandler {
// 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,
+ ExceptionHandler(const string& dump_path,
FilterCallback filter, MinidumpCallback callback,
- void *callback_context, bool install_handler,
- const char *port_name);
+ 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,
+ 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) {
+ 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_.
@@ -137,23 +137,23 @@ class ExceptionHandler {
// Convenience form of WriteMinidump which does not require an
// ExceptionHandler instance.
- static bool WriteMinidump(const string &dump_path, MinidumpCallback callback,
- void *callback_context) {
+ static bool WriteMinidump(const string& dump_path, MinidumpCallback callback,
+ void* callback_context) {
return WriteMinidump(dump_path, false, callback, callback_context);
}
- static bool WriteMinidump(const string &dump_path,
+ static bool WriteMinidump(const string& dump_path,
bool write_exception_stream,
MinidumpCallback callback,
- void *callback_context);
+ void* callback_context);
// Write a minidump of child immediately. This can be used to capture
// the execution state of a child process independently of a crash.
static bool WriteMinidumpForChild(mach_port_t child,
- mach_port_t child_blamed_thread,
- const std::string &dump_path,
- MinidumpCallback callback,
- void *callback_context);
+ mach_port_t child_blamed_thread,
+ const std::string& dump_path,
+ MinidumpCallback callback,
+ void* callback_context);
// Returns whether out-of-process dump generation is used or not.
bool IsOutOfProcess() const {
@@ -189,21 +189,21 @@ class ExceptionHandler {
bool WriteMinidumpWithException(int exception_type,
int exception_code,
int exception_subcode,
- breakpad_ucontext_t *task_context,
+ breakpad_ucontext_t* task_context,
mach_port_t thread_name,
bool exit_after_write,
bool report_current_thread);
// When installed, this static function will be call from a newly created
// pthread with |this| as the argument
- static void *WaitForMessage(void *exception_handler_class);
+ static void* WaitForMessage(void* exception_handler_class);
// Signal handler for SIGABRT.
static void SignalHandler(int sig, siginfo_t* info, void* uc);
// disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
+ 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_.
@@ -224,15 +224,15 @@ class ExceptionHandler {
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_;
+ 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_;
+ void* callback_context_;
// The callback function to be passed back when we don't want a minidump
// file to be written
@@ -247,7 +247,7 @@ class ExceptionHandler {
// These variables save the previous exception handler's data so that it
// can be re-installed when this handler is uninstalled
- ExceptionParameters *previous_;
+ ExceptionParameters* previous_;
// True, if we've installed the exception handler
bool installed_exception_handler_;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.cc
index 50df9002b34..e0351c4bbf8 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.cc
@@ -191,12 +191,12 @@ void MinidumpGenerator::GatherSystemInformation() {
os_build_number_ = IntegerValueAtIndex(product_str, 2);
}
-void MinidumpGenerator::SetTaskContext(breakpad_ucontext_t *task_context) {
+void MinidumpGenerator::SetTaskContext(breakpad_ucontext_t* task_context) {
task_context_ = task_context;
}
-string MinidumpGenerator::UniqueNameInDirectory(const string &dir,
- string *unique_name) {
+string MinidumpGenerator::UniqueNameInDirectory(const string& dir,
+ string* unique_name) {
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef uuid_cfstr = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
@@ -220,7 +220,7 @@ string MinidumpGenerator::UniqueNameInDirectory(const string &dir,
return path;
}
-bool MinidumpGenerator::Write(const char *path) {
+bool MinidumpGenerator::Write(const char* path) {
WriteStreamFN writers[] = {
&MinidumpGenerator::WriteThreadListStream,
&MinidumpGenerator::WriteMemoryListStream,
@@ -256,10 +256,10 @@ bool MinidumpGenerator::Write(const char *path) {
if (!dir.AllocateArray(writer_count))
return false;
- MDRawHeader *header_ptr = header.get();
+ MDRawHeader* header_ptr = header.get();
header_ptr->signature = MD_HEADER_SIGNATURE;
header_ptr->version = MD_HEADER_VERSION;
- time(reinterpret_cast<time_t *>(&(header_ptr->time_date_stamp)));
+ time(reinterpret_cast<time_t*>(&(header_ptr->time_date_stamp)));
header_ptr->stream_count = writer_count;
header_ptr->stream_directory_rva = dir.position();
@@ -335,7 +335,7 @@ size_t MinidumpGenerator::CalculateStackSize(mach_vm_address_t start_addr) {
bool MinidumpGenerator::WriteStackFromStartAddress(
mach_vm_address_t start_addr,
- MDMemoryDescriptor *stack_location) {
+ MDMemoryDescriptor* stack_location) {
UntypedMDRVA memory(&writer_);
bool result = false;
@@ -372,7 +372,7 @@ bool MinidumpGenerator::WriteStackFromStartAddress(
result = memory.Copy(&stack_memory[0], size);
} else {
- result = memory.Copy(reinterpret_cast<const void *>(start_addr), size);
+ result = memory.Copy(reinterpret_cast<const void*>(start_addr), size);
}
}
@@ -383,7 +383,7 @@ bool MinidumpGenerator::WriteStackFromStartAddress(
}
bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
+ MDMemoryDescriptor* stack_location) {
switch (cpu_type_) {
#ifdef HAS_ARM_SUPPORT
case CPU_TYPE_ARM:
@@ -411,7 +411,7 @@ bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
}
bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
switch (cpu_type_) {
#ifdef HAS_ARM_SUPPORT
case CPU_TYPE_ARM:
@@ -469,33 +469,33 @@ uint64_t MinidumpGenerator::CurrentPCForStack(
#ifdef HAS_ARM_SUPPORT
bool MinidumpGenerator::WriteStackARM(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ arm_thread_state_t* machine_state =
+ reinterpret_cast<arm_thread_state_t*>(state);
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp);
return WriteStackFromStartAddress(start_addr, stack_location);
}
uint64_t
MinidumpGenerator::CurrentPCForStackARM(breakpad_thread_state_data_t state) {
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
+ arm_thread_state_t* machine_state =
+ reinterpret_cast<arm_thread_state_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, pc);
}
bool MinidumpGenerator::WriteContextARM(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
+ MDLocationDescriptor* register_location)
{
TypedMDRVA<MDRawContextARM> context(&writer_);
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
+ arm_thread_state_t* machine_state =
+ reinterpret_cast<arm_thread_state_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextARM *context_ptr = context.get();
+ MDRawContextARM* context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_ARM_FULL;
#define AddGPR(a) context_ptr->iregs[a] = REGISTER_FROM_THREADSTATE(machine_state, r[a])
@@ -526,34 +526,34 @@ bool MinidumpGenerator::WriteContextARM(breakpad_thread_state_data_t state,
#ifdef HAS_ARM64_SUPPORT
bool MinidumpGenerator::WriteStackARM64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ arm_thread_state64_t* machine_state =
+ reinterpret_cast<arm_thread_state64_t*>(state);
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp);
return WriteStackFromStartAddress(start_addr, stack_location);
}
uint64_t
MinidumpGenerator::CurrentPCForStackARM64(breakpad_thread_state_data_t state) {
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
+ arm_thread_state64_t* machine_state =
+ reinterpret_cast<arm_thread_state64_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, pc);
}
bool
MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
+ MDLocationDescriptor* register_location)
{
TypedMDRVA<MDRawContextARM64_Old> context(&writer_);
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
+ arm_thread_state64_t* machine_state =
+ reinterpret_cast<arm_thread_state64_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextARM64_Old *context_ptr = context.get();
+ MDRawContextARM64_Old* context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_ARM64_FULL_OLD;
#define AddGPR(a) \
@@ -602,49 +602,49 @@ MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
#ifdef HAS_PCC_SUPPORT
bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ ppc_thread_state_t* machine_state =
+ reinterpret_cast<ppc_thread_state_t*>(state);
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1);
return WriteStackFromStartAddress(start_addr, stack_location);
}
bool MinidumpGenerator::WriteStackPPC64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ ppc_thread_state64_t* machine_state =
+ reinterpret_cast<ppc_thread_state64_t*>(state);
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1);
return WriteStackFromStartAddress(start_addr, stack_location);
}
uint64_t
MinidumpGenerator::CurrentPCForStackPPC(breakpad_thread_state_data_t state) {
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
+ ppc_thread_state_t* machine_state =
+ reinterpret_cast<ppc_thread_state_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, srr0);
}
uint64_t
MinidumpGenerator::CurrentPCForStackPPC64(breakpad_thread_state_data_t state) {
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
+ ppc_thread_state64_t* machine_state =
+ reinterpret_cast<ppc_thread_state64_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, srr0);
}
bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
+ MDLocationDescriptor* register_location)
{
TypedMDRVA<MDRawContextPPC> context(&writer_);
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
+ ppc_thread_state_t* machine_state =
+ reinterpret_cast<ppc_thread_state_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextPPC *context_ptr = context.get();
+ MDRawContextPPC* context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_PPC_BASE;
#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
@@ -701,16 +701,16 @@ bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state,
bool MinidumpGenerator::WriteContextPPC64(
breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
TypedMDRVA<MDRawContextPPC64> context(&writer_);
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
+ ppc_thread_state64_t* machine_state =
+ reinterpret_cast<ppc_thread_state64_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextPPC64 *context_ptr = context.get();
+ MDRawContextPPC64* context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_PPC_BASE;
#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
@@ -768,18 +768,18 @@ bool MinidumpGenerator::WriteContextPPC64(
#ifdef HAS_X86_SUPPORT
bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ i386_thread_state_t* machine_state =
+ reinterpret_cast<i386_thread_state_t*>(state);
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, esp);
return WriteStackFromStartAddress(start_addr, stack_location);
}
bool MinidumpGenerator::WriteStackX86_64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
+ MDMemoryDescriptor* stack_location) {
+ x86_thread_state64_t* machine_state =
+ reinterpret_cast<x86_thread_state64_t*>(state);
mach_vm_address_t start_addr = static_cast<mach_vm_address_t>(
REGISTER_FROM_THREADSTATE(machine_state, rsp));
@@ -788,32 +788,32 @@ bool MinidumpGenerator::WriteStackX86_64(breakpad_thread_state_data_t state,
uint64_t
MinidumpGenerator::CurrentPCForStackX86(breakpad_thread_state_data_t state) {
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
+ i386_thread_state_t* machine_state =
+ reinterpret_cast<i386_thread_state_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, eip);
}
uint64_t
MinidumpGenerator::CurrentPCForStackX86_64(breakpad_thread_state_data_t state) {
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
+ x86_thread_state64_t* machine_state =
+ reinterpret_cast<x86_thread_state64_t*>(state);
return REGISTER_FROM_THREADSTATE(machine_state, rip);
}
bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
+ MDLocationDescriptor* register_location)
{
TypedMDRVA<MDRawContextX86> context(&writer_);
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
+ i386_thread_state_t* machine_state =
+ reinterpret_cast<i386_thread_state_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextX86 *context_ptr = context.get();
+ MDRawContextX86* context_ptr = context.get();
#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
REGISTER_FROM_THREADSTATE(machine_state, a))
@@ -844,16 +844,16 @@ bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state,
bool MinidumpGenerator::WriteContextX86_64(
breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
+ MDLocationDescriptor* register_location) {
TypedMDRVA<MDRawContextAMD64> context(&writer_);
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
+ x86_thread_state64_t* machine_state =
+ reinterpret_cast<x86_thread_state64_t*>(state);
if (!context.Allocate())
return false;
*register_location = context.location();
- MDRawContextAMD64 *context_ptr = context.get();
+ MDRawContextAMD64* context_ptr = context.get();
#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
REGISTER_FROM_THREADSTATE(machine_state, a))
@@ -892,7 +892,7 @@ bool MinidumpGenerator::WriteContextX86_64(
bool MinidumpGenerator::GetThreadState(thread_act_t target_thread,
thread_state_t state,
- mach_msg_type_number_t *count) {
+ mach_msg_type_number_t* count) {
if (task_context_ && target_thread == mach_thread_self()) {
switch (cpu_type_) {
#ifdef HAS_ARM_SUPPORT
@@ -963,7 +963,7 @@ bool MinidumpGenerator::GetThreadState(thread_act_t target_thread,
}
bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
- MDRawThread *thread) {
+ MDRawThread* thread) {
breakpad_thread_state_data_t state;
mach_msg_type_number_t state_count
= static_cast<mach_msg_type_number_t>(sizeof(state));
@@ -986,7 +986,7 @@ bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
}
bool MinidumpGenerator::WriteThreadListStream(
- MDRawDirectory *thread_list_stream) {
+ MDRawDirectory* thread_list_stream) {
TypedMDRVA<MDRawThreadList> list(&writer_);
thread_act_port_array_t threads_for_task;
mach_msg_type_number_t thread_count;
@@ -1027,7 +1027,7 @@ bool MinidumpGenerator::WriteThreadListStream(
}
bool MinidumpGenerator::WriteMemoryListStream(
- MDRawDirectory *memory_list_stream) {
+ MDRawDirectory* memory_list_stream) {
TypedMDRVA<MDRawMemoryList> list(&writer_);
// If the dump has an exception, include some memory around the
@@ -1119,7 +1119,7 @@ bool MinidumpGenerator::WriteMemoryListStream(
} else {
// In-process, just copy from local memory.
ip_memory.Copy(
- reinterpret_cast<const void *>(ip_memory_d.start_of_memory_range),
+ reinterpret_cast<const void*>(ip_memory_d.start_of_memory_range),
ip_memory_d.memory.data_size);
}
@@ -1133,7 +1133,7 @@ bool MinidumpGenerator::WriteMemoryListStream(
}
bool
-MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) {
+MinidumpGenerator::WriteExceptionStream(MDRawDirectory* exception_stream) {
TypedMDRVA<MDRawExceptionStream> exception(&writer_);
if (!exception.Allocate())
@@ -1141,7 +1141,7 @@ MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) {
exception_stream->stream_type = MD_EXCEPTION_STREAM;
exception_stream->location = exception.location();
- MDRawExceptionStream *exception_ptr = exception.get();
+ MDRawExceptionStream* exception_ptr = exception.get();
exception_ptr->thread_id = exception_thread_;
// This naming is confusing, but it is the proper translation from
@@ -1168,7 +1168,7 @@ MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) {
}
bool MinidumpGenerator::WriteSystemInfoStream(
- MDRawDirectory *system_info_stream) {
+ MDRawDirectory* system_info_stream) {
TypedMDRVA<MDRawSystemInfo> info(&writer_);
if (!info.Allocate())
@@ -1181,7 +1181,7 @@ bool MinidumpGenerator::WriteSystemInfoStream(
uint32_t number_of_processors;
size_t len = sizeof(number_of_processors);
sysctlbyname("hw.ncpu", &number_of_processors, &len, NULL, 0);
- MDRawSystemInfo *info_ptr = info.get();
+ MDRawSystemInfo* info_ptr = info.get();
switch (cpu_type_) {
#ifdef HAS_ARM_SUPPORT
@@ -1292,10 +1292,10 @@ bool MinidumpGenerator::WriteSystemInfoStream(
}
bool MinidumpGenerator::WriteModuleStream(unsigned int index,
- MDRawModule *module) {
+ MDRawModule* module) {
if (dynamic_images_) {
// we're in a different process than the crashed process
- DynamicImage *image = dynamic_images_->GetImage(index);
+ DynamicImage* image = dynamic_images_->GetImage(index);
if (!image)
return false;
@@ -1337,7 +1337,7 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index,
}
} else {
// Getting module info in the crashed process
- const breakpad_mach_header *header;
+ const breakpad_mach_header* header;
header = (breakpad_mach_header*)_dyld_get_image_header(index);
if (!header)
return false;
@@ -1357,16 +1357,16 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index,
int cpu_type = header->cputype;
unsigned long slide = _dyld_get_image_vmaddr_slide(index);
const char* name = _dyld_get_image_name(index);
- const struct load_command *cmd =
- reinterpret_cast<const struct load_command *>(header + 1);
+ const struct load_command* cmd =
+ reinterpret_cast<const struct load_command*>(header + 1);
memset(module, 0, sizeof(MDRawModule));
for (unsigned int i = 0; cmd && (i < header->ncmds); i++) {
if (cmd->cmd == LC_SEGMENT_ARCH) {
- const breakpad_mach_segment_command *seg =
- reinterpret_cast<const breakpad_mach_segment_command *>(cmd);
+ const breakpad_mach_segment_command* seg =
+ reinterpret_cast<const breakpad_mach_segment_command*>(cmd);
if (!strcmp(seg->segname, "__TEXT")) {
MDLocationDescriptor string_location;
@@ -1389,7 +1389,7 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index,
}
}
- cmd = reinterpret_cast<struct load_command*>((char *)cmd + cmd->cmdsize);
+ cmd = reinterpret_cast<struct load_command*>((char*)cmd + cmd->cmdsize);
}
}
@@ -1405,7 +1405,7 @@ int MinidumpGenerator::FindExecutableModule() {
}
} else {
int image_count = _dyld_image_count();
- const struct mach_header *header;
+ const struct mach_header* header;
for (int index = 0; index < image_count; ++index) {
header = _dyld_get_image_header(index);
@@ -1419,12 +1419,12 @@ int MinidumpGenerator::FindExecutableModule() {
return 0;
}
-bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
- const char *module_path, bool in_memory) {
+bool MinidumpGenerator::WriteCVRecord(MDRawModule* module, int cpu_type,
+ const char* module_path, bool in_memory) {
TypedMDRVA<MDCVInfoPDB70> cv(&writer_);
// Only return the last path component of the full module path
- const char *module_name = strrchr(module_path, '/');
+ const char* module_name = strrchr(module_path, '/');
// Increment past the slash
if (module_name)
@@ -1441,7 +1441,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
return false;
module->cv_record = cv.location();
- MDCVInfoPDB70 *cv_ptr = cv.get();
+ MDCVInfoPDB70* cv_ptr = cv.get();
cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE;
cv_ptr->age = 0;
@@ -1450,7 +1450,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
bool result = false;
if (in_memory) {
MacFileUtilities::MachoID macho(module_path,
- reinterpret_cast<void *>(module->base_of_image),
+ reinterpret_cast<void*>(module->base_of_image),
static_cast<size_t>(module->size_of_image));
result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier);
if (!result)
@@ -1487,7 +1487,7 @@ bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
}
bool MinidumpGenerator::WriteModuleListStream(
- MDRawDirectory *module_list_stream) {
+ MDRawDirectory* module_list_stream) {
TypedMDRVA<MDRawModuleList> list(&writer_);
uint32_t image_count = dynamic_images_ ?
@@ -1525,7 +1525,7 @@ bool MinidumpGenerator::WriteModuleListStream(
return true;
}
-bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) {
+bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory* misc_info_stream) {
TypedMDRVA<MDRawMiscInfo> info(&writer_);
if (!info.Allocate())
@@ -1534,7 +1534,7 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) {
misc_info_stream->stream_type = MD_MISC_INFO_STREAM;
misc_info_stream->location = info.location();
- MDRawMiscInfo *info_ptr = info.get();
+ MDRawMiscInfo* info_ptr = info.get();
info_ptr->size_of_info = static_cast<uint32_t>(sizeof(MDRawMiscInfo));
info_ptr->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID |
MD_MISCINFO_FLAGS1_PROCESS_TIMES |
@@ -1577,7 +1577,7 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) {
}
bool MinidumpGenerator::WriteBreakpadInfoStream(
- MDRawDirectory *breakpad_info_stream) {
+ MDRawDirectory* breakpad_info_stream) {
TypedMDRVA<MDRawBreakpadInfo> info(&writer_);
if (!info.Allocate())
@@ -1585,7 +1585,7 @@ bool MinidumpGenerator::WriteBreakpadInfoStream(
breakpad_info_stream->stream_type = MD_BREAKPAD_INFO_STREAM;
breakpad_info_stream->location = info.location();
- MDRawBreakpadInfo *info_ptr = info.get();
+ MDRawBreakpadInfo* info_ptr = info.get();
if (exception_thread_ && exception_type_) {
info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.h b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.h
index f3aa9bd38b2..e3a271b0ba6 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/minidump_generator.h
@@ -106,12 +106,12 @@ class MinidumpGenerator {
// Return <dir>/<unique_name>.dmp
// Sets |unique_name| (if requested) to the unique name for the minidump
- static string UniqueNameInDirectory(const string &dir, string *unique_name);
+ static string UniqueNameInDirectory(const string& dir, string* unique_name);
// Write out the minidump into |path|
// All of the components of |path| must exist and be writable
// Return true if successful, false otherwise
- bool Write(const char *path);
+ bool Write(const char* path);
// Specify some exception information, if applicable
void SetExceptionInformation(int type, int code, int subcode,
@@ -125,7 +125,7 @@ class MinidumpGenerator {
// Specify the task context. If |task_context| is not NULL, it will be used
// to retrieve the context of the current thread, instead of using
// |thread_get_state|.
- void SetTaskContext(breakpad_ucontext_t *task_context);
+ void SetTaskContext(breakpad_ucontext_t* task_context);
// Gather system information. This should be call at least once before using
// the MinidumpGenerator class.
@@ -133,81 +133,81 @@ class MinidumpGenerator {
protected:
// Overridable Stream writers
- virtual bool WriteExceptionStream(MDRawDirectory *exception_stream);
+ virtual bool WriteExceptionStream(MDRawDirectory* exception_stream);
// Overridable Helper
- virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread);
+ virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread* thread);
private:
- typedef bool (MinidumpGenerator::*WriteStreamFN)(MDRawDirectory *);
+ typedef bool (MinidumpGenerator::*WriteStreamFN)(MDRawDirectory*);
// Stream writers
- bool WriteThreadListStream(MDRawDirectory *thread_list_stream);
- bool WriteMemoryListStream(MDRawDirectory *memory_list_stream);
- bool WriteSystemInfoStream(MDRawDirectory *system_info_stream);
- bool WriteModuleListStream(MDRawDirectory *module_list_stream);
- bool WriteMiscInfoStream(MDRawDirectory *misc_info_stream);
- bool WriteBreakpadInfoStream(MDRawDirectory *breakpad_info_stream);
+ bool WriteThreadListStream(MDRawDirectory* thread_list_stream);
+ bool WriteMemoryListStream(MDRawDirectory* memory_list_stream);
+ bool WriteSystemInfoStream(MDRawDirectory* system_info_stream);
+ bool WriteModuleListStream(MDRawDirectory* module_list_stream);
+ bool WriteMiscInfoStream(MDRawDirectory* misc_info_stream);
+ bool WriteBreakpadInfoStream(MDRawDirectory* breakpad_info_stream);
// Helpers
uint64_t CurrentPCForStack(breakpad_thread_state_data_t state);
bool GetThreadState(thread_act_t target_thread, thread_state_t state,
- mach_msg_type_number_t *count);
+ mach_msg_type_number_t* count);
bool WriteStackFromStartAddress(mach_vm_address_t start_addr,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteStack(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContext(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- bool WriteCVRecord(MDRawModule *module, int cpu_type,
- const char *module_path, bool in_memory);
- bool WriteModuleStream(unsigned int index, MDRawModule *module);
+ MDLocationDescriptor* register_location);
+ bool WriteCVRecord(MDRawModule* module, int cpu_type,
+ const char* module_path, bool in_memory);
+ bool WriteModuleStream(unsigned int index, MDRawModule* module);
size_t CalculateStackSize(mach_vm_address_t start_addr);
int FindExecutableModule();
// Per-CPU implementations of these methods
#ifdef HAS_ARM_SUPPORT
bool WriteStackARM(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextARM(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackARM(breakpad_thread_state_data_t state);
#endif
#ifdef HAS_ARM64_SUPPORT
bool WriteStackARM64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextARM64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackARM64(breakpad_thread_state_data_t state);
#endif
#ifdef HAS_PPC_SUPPORT
bool WriteStackPPC(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextPPC(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackPPC(breakpad_thread_state_data_t state);
bool WriteStackPPC64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextPPC64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state);
#endif
#ifdef HAS_X86_SUPPORT
bool WriteStackX86(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextX86(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackX86(breakpad_thread_state_data_t state);
bool WriteStackX86_64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
+ MDMemoryDescriptor* stack_location);
bool WriteContextX86_64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
+ MDLocationDescriptor* register_location);
uint64_t CurrentPCForStackX86_64(breakpad_thread_state_data_t state);
#endif
// disallow copy ctor and operator=
- explicit MinidumpGenerator(const MinidumpGenerator &);
- void operator=(const MinidumpGenerator &);
+ explicit MinidumpGenerator(const MinidumpGenerator&);
+ void operator=(const MinidumpGenerator&);
protected:
// Use this writer to put the data to disk
@@ -232,10 +232,10 @@ class MinidumpGenerator {
static int os_build_number_;
// Context of the task to dump.
- breakpad_ucontext_t *task_context_;
+ breakpad_ucontext_t* task_context_;
// Information about dynamically loaded code
- DynamicImages *dynamic_images_;
+ DynamicImages* dynamic_images_;
// PageAllocator makes it possible to allocate memory
// directly from the system, even while handling an exception.
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc
index 0fc7825b24c..0a80e434c72 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc
@@ -42,7 +42,7 @@ DynamicImagesTests test2(TEST_INVOCATION(DynamicImagesTests,
DynamicImagesTests test3(TEST_INVOCATION(DynamicImagesTests,
ReadLibrariesFromLocalTaskTest));
-DynamicImagesTests::DynamicImagesTests(TestInvocation *invocation)
+DynamicImagesTests::DynamicImagesTests(TestInvocation* invocation)
: TestCase(invocation) {
}
@@ -54,7 +54,7 @@ void DynamicImagesTests::ReadTaskMemoryTest() {
// pick test2 as a symbol we know to be valid to read
// anything will work, really
- void *addr = reinterpret_cast<void*>(&test2);
+ void* addr = reinterpret_cast<void*>(&test2);
std::vector<uint8_t> buf(getpagesize());
fprintf(stderr, "reading 0x%p\n", addr);
@@ -71,7 +71,7 @@ void DynamicImagesTests::ReadTaskMemoryTest() {
void DynamicImagesTests::ReadLibrariesFromLocalTaskTest() {
mach_port_t me = mach_task_self();
- google_breakpad::DynamicImages *d = new google_breakpad::DynamicImages(me);
+ google_breakpad::DynamicImages* d = new google_breakpad::DynamicImages(me);
fprintf(stderr,"Local task image count: %d\n", d->GetImageCount());
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc
index e7332bfb65a..2014b9078dc 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc
@@ -40,7 +40,7 @@
BreakpadNlistTest test1(TEST_INVOCATION(BreakpadNlistTest, CompareToNM));
-BreakpadNlistTest::BreakpadNlistTest(TestInvocation *invocation)
+BreakpadNlistTest::BreakpadNlistTest(TestInvocation* invocation)
: TestCase(invocation) {
}
@@ -55,7 +55,7 @@ void BreakpadNlistTest::CompareToNM() {
system("/usr/bin/nm -arch ppc64 /usr/lib/dyld > /tmp/dyld-namelist.txt");
#endif
- FILE *fd = fopen("/tmp/dyld-namelist.txt", "rt");
+ FILE* fd = fopen("/tmp/dyld-namelist.txt", "rt");
char oneNMAddr[30];
char symbolType;
@@ -63,10 +63,10 @@ void BreakpadNlistTest::CompareToNM() {
while (!feof(fd)) {
fscanf(fd, "%s %c %s", oneNMAddr, &symbolType, symbolName);
breakpad_nlist symbolList[2];
- breakpad_nlist &list = symbolList[0];
+ breakpad_nlist& list = symbolList[0];
memset(symbolList, 0, sizeof(breakpad_nlist)*2);
- const char *symbolNames[2];
+ const char* symbolNames[2];
symbolNames[0] = (const char*)symbolName;
symbolNames[1] = "\0";
breakpad_nlist_64("/usr/lib/dyld", &list, symbolNames);
@@ -79,12 +79,12 @@ void BreakpadNlistTest::CompareToNM() {
fclose(fd);
}
-bool BreakpadNlistTest::IsSymbolMoreThanOnceInDyld(const char *symbolName) {
+bool BreakpadNlistTest::IsSymbolMoreThanOnceInDyld(const char* symbolName) {
// These are the symbols that occur more than once when nm dumps
// the symbol table of /usr/lib/dyld. Our nlist program returns
// the first address because it's doing a search so we need to exclude
// these from causing the test to fail
- const char *multipleSymbols[] = {
+ const char* multipleSymbols[] = {
"__Z41__static_initialization_and_destruction_0ii",
"___tcf_0",
"___tcf_1",
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h
index e93657cc908..ee8010c752a 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h
@@ -47,7 +47,7 @@ class BreakpadNlistTest : public TestCase {
// /usr/lib/dyld. So we track those so we don't report failures
// in mismatches between what our nlist returns and what nm has
// for the duplicate symbols.
- bool IsSymbolMoreThanOnceInDyld(const char *symbolName);
+ bool IsSymbolMoreThanOnceInDyld(const char* symbolName);
public:
explicit BreakpadNlistTest(TestInvocation* invocation);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/mac/testapp/main.m b/chromium/third_party/breakpad/breakpad/src/client/mac/testapp/main.m
index 1ed19bf961c..de673326906 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/mac/testapp/main.m
+++ b/chromium/third_party/breakpad/breakpad/src/client/mac/testapp/main.m
@@ -30,5 +30,5 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[]) {
- return NSApplicationMain(argc, (const char **) argv);
+ return NSApplicationMain(argc, (const char**)argv);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer-inl.h b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer-inl.h
index 0e12e00b69e..bdac2dae843 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer-inl.h
@@ -69,7 +69,7 @@ inline bool TypedMDRVA<MDType>::AllocateObjectAndArray(size_t count,
}
template<typename MDType>
-inline bool TypedMDRVA<MDType>::CopyIndex(unsigned int index, MDType *item) {
+inline bool TypedMDRVA<MDType>::CopyIndex(unsigned int index, MDType* item) {
assert(allocation_state_ == ARRAY);
return writer_->Copy(
static_cast<MDRVA>(position_ + index * minidump_size<MDType>::size()),
@@ -78,7 +78,7 @@ inline bool TypedMDRVA<MDType>::CopyIndex(unsigned int index, MDType *item) {
template<typename MDType>
inline bool TypedMDRVA<MDType>::CopyIndexAfterObject(unsigned int index,
- const void *src,
+ const void* src,
size_t length) {
assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY);
return writer_->Copy(
diff --git a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.cc b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.cc
index a1957f324a9..5c3c5cbb0a9 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.cc
@@ -101,7 +101,7 @@ MinidumpFileWriter::~MinidumpFileWriter() {
Close();
}
-bool MinidumpFileWriter::Open(const char *path) {
+bool MinidumpFileWriter::Open(const char* path) {
assert(file_ == -1);
#if defined(__linux__) && __linux__
file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600);
@@ -145,9 +145,9 @@ bool MinidumpFileWriter::Close() {
return result;
}
-bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str,
+bool MinidumpFileWriter::CopyStringToMDString(const wchar_t* str,
unsigned int length,
- TypedMDRVA<MDString> *mdstring) {
+ TypedMDRVA<MDString>* mdstring) {
bool result = true;
if (sizeof(wchar_t) == sizeof(uint16_t)) {
// Shortcut if wchar_t is the same size as MDString's buffer
@@ -178,9 +178,9 @@ bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str,
return result;
}
-bool MinidumpFileWriter::CopyStringToMDString(const char *str,
+bool MinidumpFileWriter::CopyStringToMDString(const char* str,
unsigned int length,
- TypedMDRVA<MDString> *mdstring) {
+ TypedMDRVA<MDString>* mdstring) {
bool result = true;
uint16_t out[2];
int out_idx = 0;
@@ -205,9 +205,9 @@ bool MinidumpFileWriter::CopyStringToMDString(const char *str,
}
template <typename CharType>
-bool MinidumpFileWriter::WriteStringCore(const CharType *str,
+bool MinidumpFileWriter::WriteStringCore(const CharType* str,
unsigned int length,
- MDLocationDescriptor *location) {
+ MDLocationDescriptor* location) {
assert(str);
assert(location);
// Calculate the mdstring length by either limiting to |length| as passed in
@@ -240,18 +240,18 @@ bool MinidumpFileWriter::WriteStringCore(const CharType *str,
return result;
}
-bool MinidumpFileWriter::WriteString(const wchar_t *str, unsigned int length,
- MDLocationDescriptor *location) {
+bool MinidumpFileWriter::WriteString(const wchar_t* str, unsigned int length,
+ MDLocationDescriptor* location) {
return WriteStringCore(str, length, location);
}
-bool MinidumpFileWriter::WriteString(const char *str, unsigned int length,
- MDLocationDescriptor *location) {
+bool MinidumpFileWriter::WriteString(const char* str, unsigned int length,
+ MDLocationDescriptor* location) {
return WriteStringCore(str, length, location);
}
-bool MinidumpFileWriter::WriteMemory(const void *src, size_t size,
- MDMemoryDescriptor *output) {
+bool MinidumpFileWriter::WriteMemory(const void* src, size_t size,
+ MDMemoryDescriptor* output) {
assert(src);
assert(output);
UntypedMDRVA mem(this);
@@ -307,7 +307,7 @@ MDRVA MinidumpFileWriter::Allocate(size_t size) {
return current_position;
}
-bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) {
+bool MinidumpFileWriter::Copy(MDRVA position, const void* src, ssize_t size) {
assert(src);
assert(size);
assert(file_ != -1);
@@ -340,7 +340,7 @@ bool UntypedMDRVA::Allocate(size_t size) {
return position_ != MinidumpFileWriter::kInvalidMDRVA;
}
-bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) {
+bool UntypedMDRVA::Copy(MDRVA pos, const void* src, size_t size) {
assert(src);
assert(size);
assert(pos + size <= position_ + size_);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.h b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.h
index ce32b6d0879..c66dc591263 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer.h
@@ -77,7 +77,7 @@ public:
// Open |path| as the destination of the minidump data. If |path| already
// exists, then Open() will fail.
// Return true on success, or false on failure.
- bool Open(const char *path);
+ bool Open(const char* path);
// Sets the file descriptor |file| as the destination of the minidump data.
// Can be used as an alternative to Open() when a file descriptor is
@@ -98,20 +98,20 @@ public:
// entire NULL terminated string. Copying will stop at the first NULL.
// |location| the allocated location
// Return true on success, or false on failure
- bool WriteString(const wchar_t *str, unsigned int length,
- MDLocationDescriptor *location);
+ bool WriteString(const wchar_t* str, unsigned int length,
+ MDLocationDescriptor* location);
// Same as above, except with |str| as a UTF-8 string
- bool WriteString(const char *str, unsigned int length,
- MDLocationDescriptor *location);
+ bool WriteString(const char* str, unsigned int length,
+ MDLocationDescriptor* location);
// Write |size| bytes starting at |src| into the current position.
// Return true on success and set |output| to position, or false on failure
- bool WriteMemory(const void *src, size_t size, MDMemoryDescriptor *output);
+ bool WriteMemory(const void* src, size_t size, MDMemoryDescriptor* output);
// Copies |size| bytes from |src| to |position|
// Return true on success, or false on failure
- bool Copy(MDRVA position, const void *src, ssize_t size);
+ bool Copy(MDRVA position, const void* src, ssize_t size);
// Return the current position for writing to the minidump
inline MDRVA position() const { return position_; }
@@ -141,21 +141,21 @@ public:
// variant may need to create a MDString that has more characters than the
// source |str|, whereas the UTF-8 variant may coalesce characters to form
// a single UTF-16 character.
- bool CopyStringToMDString(const wchar_t *str, unsigned int length,
- TypedMDRVA<MDString> *mdstring);
- bool CopyStringToMDString(const char *str, unsigned int length,
- TypedMDRVA<MDString> *mdstring);
+ bool CopyStringToMDString(const wchar_t* str, unsigned int length,
+ TypedMDRVA<MDString>* mdstring);
+ bool CopyStringToMDString(const char* str, unsigned int length,
+ TypedMDRVA<MDString>* mdstring);
// The common templated code for writing a string
template <typename CharType>
- bool WriteStringCore(const CharType *str, unsigned int length,
- MDLocationDescriptor *location);
+ bool WriteStringCore(const CharType* str, unsigned int length,
+ MDLocationDescriptor* location);
};
// Represents an untyped allocated chunk
class UntypedMDRVA {
public:
- explicit UntypedMDRVA(MinidumpFileWriter *writer)
+ explicit UntypedMDRVA(MinidumpFileWriter* writer)
: writer_(writer),
position_(writer->position()),
size_(0) {}
@@ -179,16 +179,16 @@ class UntypedMDRVA {
// Copy |size| bytes starting at |src| into the minidump at |position|
// Return true on success, or false on failure
- bool Copy(MDRVA position, const void *src, size_t size);
+ bool Copy(MDRVA position, const void* src, size_t size);
// Copy |size| bytes from |src| to the current position
- inline bool Copy(const void *src, size_t size) {
+ inline bool Copy(const void* src, size_t size) {
return Copy(position_, src, size);
}
protected:
// Writer we associate with
- MinidumpFileWriter *writer_;
+ MinidumpFileWriter* writer_;
// Position of the start of the data
MDRVA position_;
@@ -206,7 +206,7 @@ template<typename MDType>
class TypedMDRVA : public UntypedMDRVA {
public:
// Constructs an unallocated MDRVA
- explicit TypedMDRVA(MinidumpFileWriter *writer)
+ explicit TypedMDRVA(MinidumpFileWriter* writer)
: UntypedMDRVA(writer),
data_(),
allocation_state_(UNALLOCATED) {}
@@ -220,7 +220,7 @@ class TypedMDRVA : public UntypedMDRVA {
// Address of object data_ of MDType. This is not declared const as the
// typical usage will be to access the underlying |data_| object as to
// alter its contents.
- MDType *get() { return &data_; }
+ MDType* get() { return &data_; }
// Allocates minidump_size<MDType>::size() bytes.
// Must not call more than once.
@@ -245,12 +245,12 @@ class TypedMDRVA : public UntypedMDRVA {
// Copy |item| to |index|
// Must have been allocated using AllocateArray().
// Return true on success, or false on failure
- bool CopyIndex(unsigned int index, MDType *item);
+ bool CopyIndex(unsigned int index, MDType* item);
// Copy |size| bytes starting at |str| to |index|
// Must have been allocated using AllocateObjectAndArray().
// Return true on success, or false on failure
- bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size);
+ bool CopyIndexAfterObject(unsigned int index, const void* src, size_t size);
// Write data_
bool Flush();
diff --git a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer_unittest.cc b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer_unittest.cc
index 256e3371273..16c407d2e45 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/minidump_file_writer_unittest.cc
@@ -70,16 +70,16 @@ typedef struct {
ArrayStructure array[0];
} ObjectAndArrayStructure;
-static bool WriteFile(const char *path) {
+static bool WriteFile(const char* path) {
MinidumpFileWriter writer;
if (writer.Open(path)) {
// Test a single structure
google_breakpad::TypedMDRVA<StringStructure> strings(&writer);
ASSERT_TRUE(strings.Allocate());
strings.get()->integer_value = 0xBEEF;
- const char *first = "First String";
+ const char* first = "First String";
ASSERT_TRUE(writer.WriteString(first, 0, &strings.get()->first_string));
- const wchar_t *second = L"Second String";
+ const wchar_t* second = L"Second String";
ASSERT_TRUE(writer.WriteString(second, 0, &strings.get()->second_string));
// Test an array structure
@@ -111,7 +111,7 @@ static bool WriteFile(const char *path) {
return writer.Close();
}
-static bool CompareFile(const char *path) {
+static bool CompareFile(const char* path) {
unsigned long expected[] = {
#if defined(__BIG_ENDIAN__)
0x0000beef, 0x0000001e, 0x00000018, 0x00000020, 0x00000038, 0x00000000,
@@ -146,13 +146,14 @@ static bool CompareFile(const char *path) {
};
size_t expected_byte_count = sizeof(expected);
int fd = open(path, O_RDONLY, 0600);
- void *buffer = malloc(expected_byte_count);
+ void* buffer = malloc(expected_byte_count);
ASSERT_NE(fd, -1);
ASSERT_TRUE(buffer);
ASSERT_EQ(read(fd, buffer, expected_byte_count),
static_cast<ssize_t>(expected_byte_count));
- char *b1, *b2;
+ char* b1;
+ char* b2;
b1 = reinterpret_cast<char*>(buffer);
b2 = reinterpret_cast<char*>(expected);
while (*b1 == *b2) {
@@ -167,13 +168,13 @@ static bool CompareFile(const char *path) {
}
static bool RunTests() {
- const char *path = "/tmp/minidump_file_writer_unittest.dmp";
+ const char* path = "/tmp/minidump_file_writer_unittest.dmp";
ASSERT_TRUE(WriteFile(path));
ASSERT_TRUE(CompareFile(path));
unlink(path);
return true;
}
-extern "C" int main(int argc, const char *argv[]) {
+extern "C" int main(int argc, const char* argv[]) {
return RunTests() ? 0 : 1;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.cc
index 7fc8d2557e6..c96683f6f5d 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.cc
@@ -54,15 +54,15 @@ static const int kSigTable[] = {
SIGBUS
};
-std::vector<ExceptionHandler*> *ExceptionHandler::handler_stack_ = NULL;
+std::vector<ExceptionHandler*>* ExceptionHandler::handler_stack_ = NULL;
int ExceptionHandler::handler_stack_index_ = 0;
pthread_mutex_t ExceptionHandler::handler_stack_mutex_ =
PTHREAD_MUTEX_INITIALIZER;
-ExceptionHandler::ExceptionHandler(const string &dump_path,
+ExceptionHandler::ExceptionHandler(const string& dump_path,
FilterCallback filter,
MinidumpCallback callback,
- void *callback_context,
+ void* callback_context,
bool install_handler)
: filter_(filter),
callback_(callback),
@@ -79,7 +79,7 @@ ExceptionHandler::ExceptionHandler(const string &dump_path,
pthread_mutex_lock(&handler_stack_mutex_);
if (handler_stack_ == NULL)
- handler_stack_ = new std::vector<ExceptionHandler *>;
+ handler_stack_ = new std::vector<ExceptionHandler*>;
handler_stack_->push_back(this);
pthread_mutex_unlock(&handler_stack_mutex_);
}
@@ -92,7 +92,7 @@ ExceptionHandler::~ExceptionHandler() {
handler_stack_->pop_back();
} else {
print_message1(2, "warning: removing Breakpad handler out of order\n");
- for (std::vector<ExceptionHandler *>::iterator iterator =
+ for (std::vector<ExceptionHandler*>::iterator iterator =
handler_stack_->begin();
iterator != handler_stack_->end();
++iterator) {
@@ -116,9 +116,9 @@ bool ExceptionHandler::WriteMinidump() {
}
// static
-bool ExceptionHandler::WriteMinidump(const string &dump_path,
+bool ExceptionHandler::WriteMinidump(const string& dump_path,
MinidumpCallback callback,
- void *callback_context) {
+ void* callback_context) {
ExceptionHandler handler(dump_path, NULL, callback,
callback_context, false);
return handler.InternalWriteMinidump(0, 0, NULL);
@@ -166,7 +166,7 @@ void ExceptionHandler::TeardownAllHandlers() {
// static
void ExceptionHandler::HandleException(int signo) {
-//void ExceptionHandler::HandleException(int signo, siginfo_t *sip, ucontext_t *sig_ctx) {
+//void ExceptionHandler::HandleException(int signo, siginfo_t* sip, ucontext_t* sig_ctx) {
// The context information about the signal is put on the stack of
// the signal handler frame as value parameter. For some reasons, the
// prototype of the handler doesn't declare this information as parameter, we
@@ -181,14 +181,14 @@ void ExceptionHandler::HandleException(int signo) {
uintptr_t current_ebp = (uintptr_t)_getfp();
pthread_mutex_lock(&handler_stack_mutex_);
- ExceptionHandler *current_handler =
+ ExceptionHandler* current_handler =
handler_stack_->at(handler_stack_->size() - ++handler_stack_index_);
pthread_mutex_unlock(&handler_stack_mutex_);
// Restore original handler.
current_handler->TeardownHandler(signo);
- ucontext_t *sig_ctx = NULL;
+ ucontext_t* sig_ctx = NULL;
if (current_handler->InternalWriteMinidump(signo, current_ebp, &sig_ctx)) {
// if (current_handler->InternalWriteMinidump(signo, &sig_ctx)) {
// Fully handled this exception, safe to exit.
@@ -218,7 +218,7 @@ void ExceptionHandler::HandleException(int signo) {
bool ExceptionHandler::InternalWriteMinidump(int signo,
uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) {
+ ucontext_t** sig_ctx) {
if (filter_ && !filter_(callback_context_))
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.h b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.h
index 4d72485feb6..cd6c85ea1eb 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler.h
@@ -79,7 +79,7 @@ class ExceptionHandler {
// 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);
+ 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
@@ -97,9 +97,9 @@ class ExceptionHandler {
// should normally return the value of |succeeded|, or when they wish to
// not report an exception of handled, false. Callbacks will rarely want to
// return true directly (unless |succeeded| is true).
- typedef bool (*MinidumpCallback)(const char *dump_path,
- const char *minidump_id,
- void *context,
+ typedef bool (*MinidumpCallback)(const char* dump_path,
+ const char* minidump_id,
+ void* context,
bool succeeded);
// Creates a new ExceptionHandler instance to handle writing minidumps.
@@ -110,15 +110,15 @@ class ExceptionHandler {
// 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.
- ExceptionHandler(const string &dump_path,
+ ExceptionHandler(const string& dump_path,
FilterCallback filter, MinidumpCallback callback,
- void *callback_context,
+ 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) {
+ void set_dump_path(const string& dump_path) {
dump_path_ = dump_path;
dump_path_c_ = dump_path_.c_str();
}
@@ -129,9 +129,9 @@ class ExceptionHandler {
// Convenience form of WriteMinidump which does not require an
// ExceptionHandler instance.
- static bool WriteMinidump(const string &dump_path,
+ static bool WriteMinidump(const string& dump_path,
MinidumpCallback callback,
- void *callback_context);
+ void* callback_context);
private:
// Setup crash handler.
@@ -144,7 +144,7 @@ class ExceptionHandler {
void TeardownAllHandlers();
// Runs the main loop for the exception handler thread.
- static void* ExceptionHandlerThreadMain(void *lpParameter);
+ static void* ExceptionHandlerThreadMain(void* lpParameter);
// Signal handler.
static void HandleException(int signo);
@@ -157,20 +157,20 @@ class ExceptionHandler {
// for the second and third parameters if you are not calling
// this from a signal handler.
bool InternalWriteMinidump(int signo, uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx);
+ ucontext_t** sig_ctx);
private:
// The callbacks before and after writing the dump file.
FilterCallback filter_;
MinidumpCallback callback_;
- void *callback_context_;
+ void* callback_context_;
// The directory in which a minidump will be written, set by the dump_path
// argument to the constructor, or set_dump_path.
string dump_path_;
// C style dump path. Keep this when setting dump path, since calling
// c_str() of std::string when crashing may not be safe.
- const char *dump_path_c_;
+ const char* dump_path_c_;
// True if the ExceptionHandler installed an unhandled exception filter
// when created (with an install_handler parameter set to true).
@@ -183,7 +183,7 @@ class ExceptionHandler {
// The global exception handler stack. This is need becuase there may exist
// multiple ExceptionHandler instances in a process. Each will have itself
// registered in this stack.
- static std::vector<ExceptionHandler *> *handler_stack_;
+ static std::vector<ExceptionHandler*>* handler_stack_;
// The index of the handler that should handle the next exception.
static int handler_stack_index_;
static pthread_mutex_t handler_stack_mutex_;
@@ -192,8 +192,8 @@ class ExceptionHandler {
MinidumpGenerator minidump_generator_;
// disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
+ explicit ExceptionHandler(const ExceptionHandler&);
+ void operator=(const ExceptionHandler&);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler_test.cc b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler_test.cc
index 6bb8e18d959..4d2b33faf76 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/exception_handler_test.cc
@@ -49,7 +49,7 @@ static int foo2(int arg) {
// Stack variable, used for debugging stack dumps.
int c = 0xcccccccc;
fprintf(stderr, "Thread trying to crash: %x\n", getpid());
- c = *reinterpret_cast<int *>(0x5);
+ c = *reinterpret_cast<int*>(0x5);
return c;
}
@@ -60,7 +60,7 @@ static int foo(int arg) {
return b;
}
-static void *thread_crash(void *) {
+static void* thread_crash(void*) {
// Stack variable, used for debugging stack dumps.
int a = 0xaaaaaaaa;
sleep(3);
@@ -69,7 +69,7 @@ static void *thread_crash(void *) {
return NULL;
}
-static void *thread_main(void *) {
+static void* thread_main(void*) {
while (!should_exit)
sleep(1);
return NULL;
@@ -91,9 +91,9 @@ static void CreateThread(int num) {
}
// Callback when minidump written.
-static bool MinidumpCallback(const char *dump_path,
- const char *minidump_id,
- void *context,
+static bool MinidumpCallback(const char* dump_path,
+ const char* minidump_id,
+ void* context,
bool succeeded) {
int index = reinterpret_cast<int>(context);
if (index == 0) {
@@ -104,7 +104,7 @@ static bool MinidumpCallback(const char *dump_path,
return false;
}
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
int handler_index = 1;
ExceptionHandler handler_ignore(".", NULL, MinidumpCallback,
(void*)handler_index, true);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.cc b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.cc
index 7485025fe45..56756665586 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.cc
@@ -50,7 +50,7 @@ using namespace google_breakpad;
// Argument for the writer function.
struct WriterArgument {
- MinidumpFileWriter *minidump_writer;
+ MinidumpFileWriter* minidump_writer;
// Pid of the lwp who called WriteMinidumpToFile
int requester_pid;
@@ -73,15 +73,15 @@ struct WriterArgument {
// User context when crash happens. Can be NULL if this is a requested dump.
// This is actually an out parameter, but it will be filled in at the start
// of the writer LWP.
- ucontext_t *sig_ctx;
+ ucontext_t* sig_ctx;
// Used to get information about the lwps.
- SolarisLwp *lwp_lister;
+ SolarisLwp* lwp_lister;
};
// Holding context information for the callback of finding the crashing lwp.
struct FindCrashLwpContext {
- const SolarisLwp *lwp_lister;
+ const SolarisLwp* lwp_lister;
uintptr_t crashing_stack_bottom;
int crashing_lwpid;
@@ -96,11 +96,11 @@ struct FindCrashLwpContext {
// It will compare the stack bottom of the provided lwp with the stack
// bottom of the crashed lwp, it they are eqaul, this lwp is the one
// who crashed.
-bool IsLwpCrashedCallback(lwpstatus_t *lsp, void *context) {
- FindCrashLwpContext *crashing_context =
- static_cast<FindCrashLwpContext *>(context);
- const SolarisLwp *lwp_lister = crashing_context->lwp_lister;
- const prgregset_t *gregs = &(lsp->pr_reg);
+bool IsLwpCrashedCallback(lwpstatus_t* lsp, void* context) {
+ FindCrashLwpContext* crashing_context =
+ static_cast<FindCrashLwpContext*>(context);
+ const SolarisLwp* lwp_lister = crashing_context->lwp_lister;
+ const prgregset_t* gregs = &(lsp->pr_reg);
#if TARGET_CPU_SPARC
uintptr_t last_ebp = (*gregs)[R_FP];
#elif TARGET_CPU_X86
@@ -121,7 +121,7 @@ bool IsLwpCrashedCallback(lwpstatus_t *lsp, void *context) {
// This is done based on stack bottom comparing.
int FindCrashingLwp(uintptr_t crashing_stack_bottom,
int requester_pid,
- const SolarisLwp *lwp_lister) {
+ const SolarisLwp* lwp_lister) {
FindCrashLwpContext context;
context.lwp_lister = lwp_lister;
context.crashing_stack_bottom = crashing_stack_bottom;
@@ -131,17 +131,17 @@ int FindCrashingLwp(uintptr_t crashing_stack_bottom,
return context.crashing_lwpid;
}
-bool WriteLwpStack(const SolarisLwp *lwp_lister,
+bool WriteLwpStack(const SolarisLwp* lwp_lister,
uintptr_t last_esp,
- UntypedMDRVA *memory,
- MDMemoryDescriptor *loc) {
+ UntypedMDRVA* memory,
+ MDMemoryDescriptor* loc) {
uintptr_t stack_bottom = lwp_lister->GetLwpStackBottom(last_esp);
if (stack_bottom >= last_esp) {
int size = stack_bottom - last_esp;
if (size > 0) {
if (!memory->Allocate(size))
return false;
- memory->Copy(reinterpret_cast<void *>(last_esp), size);
+ memory->Copy(reinterpret_cast<void*>(last_esp), size);
loc->start_of_memory_range = last_esp;
loc->memory = memory->location();
}
@@ -151,7 +151,7 @@ bool WriteLwpStack(const SolarisLwp *lwp_lister,
}
#if TARGET_CPU_SPARC
-bool WriteContext(MDRawContextSPARC *context, ucontext_t *sig_ctx) {
+bool WriteContext(MDRawContextSPARC* context, ucontext_t* sig_ctx) {
assert(sig_ctx != NULL);
int* regs = sig_ctx->uc_mcontext.gregs;
context->context_flags = MD_CONTEXT_SPARC_FULL;
@@ -170,13 +170,13 @@ bool WriteContext(MDRawContextSPARC *context, ucontext_t *sig_ctx) {
for ( int i = 1 ; i < 16; ++i ) {
context->g_r[i] = (uintptr_t)(sig_ctx->uc_mcontext.gregs[i + 3]);
}
- context->g_r[30] = (uintptr_t)(((struct frame *)context->g_r[14])->fr_savfp);
+ context->g_r[30] = (uintptr_t)(((struct frame*)context->g_r[14])->fr_savfp);
return true;
}
-bool WriteContext(MDRawContextSPARC *context, prgregset_t regs,
- prfpregset_t *fp_regs) {
+bool WriteContext(MDRawContextSPARC* context, prgregset_t regs,
+ prfpregset_t* fp_regs) {
if (!context || !regs)
return false;
@@ -195,8 +195,8 @@ bool WriteContext(MDRawContextSPARC *context, prgregset_t regs,
return true;
}
#elif TARGET_CPU_X86
-bool WriteContext(MDRawContextX86 *context, prgregset_t regs,
- prfpregset_t *fp_regs) {
+bool WriteContext(MDRawContextX86* context, prgregset_t regs,
+ prfpregset_t* fp_regs) {
if (!context || !regs)
return false;
@@ -228,10 +228,10 @@ bool WriteContext(MDRawContextX86 *context, prgregset_t regs,
// signal. This makes the current stack not reliable, and our stack walker
// won't figure out the whole call stack for this. So we write the stack at the
// time of the crash into the minidump file, not the current stack.
-bool WriteCrashedLwpStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- const lwpstatus_t *lsp,
- MDRawThread *lwp) {
+bool WriteCrashedLwpStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ const lwpstatus_t* lsp,
+ MDRawThread* lwp) {
assert(writer_args->sig_ctx != NULL);
lwp->thread_id = lsp->pr_lwpid;
@@ -264,16 +264,16 @@ bool WriteCrashedLwpStream(MinidumpFileWriter *minidump_writer,
lwp->thread_context = context.location();
memset(context.get(), 0, sizeof(MDRawContextX86));
return WriteContext(context.get(),
- (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
+ (int*)&writer_args->sig_ctx->uc_mcontext.gregs,
&writer_args->sig_ctx->uc_mcontext.fpregs);
#endif
}
-bool WriteLwpStream(MinidumpFileWriter *minidump_writer,
- const SolarisLwp *lwp_lister,
- const lwpstatus_t *lsp, MDRawThread *lwp) {
+bool WriteLwpStream(MinidumpFileWriter* minidump_writer,
+ const SolarisLwp* lwp_lister,
+ const lwpstatus_t* lsp, MDRawThread* lwp) {
prfpregset_t fp_regs = lsp->pr_fpreg;
- const prgregset_t *gregs = &(lsp->pr_reg);
+ const prgregset_t* gregs = &(lsp->pr_reg);
UntypedMDRVA memory(minidump_writer);
#if TARGET_CPU_SPARC
if (!WriteLwpStack(lwp_lister,
@@ -306,10 +306,10 @@ bool WriteLwpStream(MinidumpFileWriter *minidump_writer,
lwp->thread_context = context.location();
memset(context.get(), 0, sizeof(MDRawContextX86));
#endif /* TARGET_CPU_XXX */
- return WriteContext(context.get(), (int *)gregs, &fp_regs);
+ return WriteContext(context.get(), (int*)gregs, &fp_regs);
}
-bool WriteCPUInformation(MDRawSystemInfo *sys_info) {
+bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
struct utsname uts;
char *major, *minor, *build;
@@ -337,8 +337,8 @@ bool WriteCPUInformation(MDRawSystemInfo *sys_info) {
return true;
}
-bool WriteOSInformation(MinidumpFileWriter *minidump_writer,
- MDRawSystemInfo *sys_info) {
+bool WriteOSInformation(MinidumpFileWriter* minidump_writer,
+ MDRawSystemInfo* sys_info) {
sys_info->platform_id = MD_OS_SOLARIS;
struct utsname uts;
@@ -346,7 +346,7 @@ bool WriteOSInformation(MinidumpFileWriter *minidump_writer,
char os_version[512];
size_t space_left = sizeof(os_version);
memset(os_version, 0, space_left);
- const char *os_info_table[] = {
+ const char* os_info_table[] = {
uts.sysname,
uts.release,
uts.version,
@@ -354,7 +354,7 @@ bool WriteOSInformation(MinidumpFileWriter *minidump_writer,
"OpenSolaris",
NULL
};
- for (const char **cur_os_info = os_info_table;
+ for (const char** cur_os_info = os_info_table;
*cur_os_info != NULL;
++cur_os_info) {
if (cur_os_info != os_info_table && space_left > 1) {
@@ -379,21 +379,21 @@ bool WriteOSInformation(MinidumpFileWriter *minidump_writer,
// Callback context for get writting lwp information.
struct LwpInfoCallbackCtx {
- MinidumpFileWriter *minidump_writer;
- const WriterArgument *writer_args;
- TypedMDRVA<MDRawThreadList> *list;
+ MinidumpFileWriter* minidump_writer;
+ const WriterArgument* writer_args;
+ TypedMDRVA<MDRawThreadList>* list;
int lwp_index;
};
-bool LwpInformationCallback(lwpstatus_t *lsp, void *context) {
+bool LwpInformationCallback(lwpstatus_t* lsp, void* context) {
bool success = true;
- LwpInfoCallbackCtx *callback_context =
- static_cast<LwpInfoCallbackCtx *>(context);
+ LwpInfoCallbackCtx* callback_context =
+ static_cast<LwpInfoCallbackCtx*>(context);
// The current lwp is the one to handle the crash. Ignore it.
if (lsp->pr_lwpid != pthread_self()) {
- LwpInfoCallbackCtx *callback_context =
- static_cast<LwpInfoCallbackCtx *>(context);
+ LwpInfoCallbackCtx* callback_context =
+ static_cast<LwpInfoCallbackCtx*>(context);
MDRawThread lwp;
memset(&lwp, 0, sizeof(MDRawThread));
@@ -417,11 +417,11 @@ bool LwpInformationCallback(lwpstatus_t *lsp, void *context) {
return success;
}
-bool WriteLwpListStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteLwpListStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
// Get the lwp information.
- const SolarisLwp *lwp_lister = writer_args->lwp_lister;
+ const SolarisLwp* lwp_lister = writer_args->lwp_lister;
int lwp_count = lwp_lister->GetLwpCount();
if (lwp_count < 0)
return false;
@@ -444,14 +444,14 @@ bool WriteLwpListStream(MinidumpFileWriter *minidump_writer,
return written == lwp_count;
}
-bool WriteCVRecord(MinidumpFileWriter *minidump_writer,
- MDRawModule *module,
- const char *module_path,
- char *realname) {
+bool WriteCVRecord(MinidumpFileWriter* minidump_writer,
+ MDRawModule* module,
+ const char* module_path,
+ char* realname) {
TypedMDRVA<MDCVInfoPDB70> cv(minidump_writer);
char path[PATH_MAX];
- const char *module_name = module_path ? module_path : "<Unknown>";
+ const char* module_name = module_path ? module_path : "<Unknown>";
snprintf(path, sizeof(path), "/proc/self/object/%s", module_name);
size_t module_name_length = strlen(realname);
@@ -461,7 +461,7 @@ bool WriteCVRecord(MinidumpFileWriter *minidump_writer,
return false;
module->cv_record = cv.location();
- MDCVInfoPDB70 *cv_ptr = cv.get();
+ MDCVInfoPDB70* cv_ptr = cv.get();
memset(cv_ptr, 0, sizeof(MDCVInfoPDB70));
cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE;
cv_ptr->age = 0;
@@ -489,15 +489,15 @@ bool WriteCVRecord(MinidumpFileWriter *minidump_writer,
}
struct ModuleInfoCallbackCtx {
- MinidumpFileWriter *minidump_writer;
- const WriterArgument *writer_args;
- TypedMDRVA<MDRawModuleList> *list;
+ MinidumpFileWriter* minidump_writer;
+ const WriterArgument* writer_args;
+ TypedMDRVA<MDRawModuleList>* list;
int module_index;
};
-bool ModuleInfoCallback(const ModuleInfo &module_info, void *context) {
- ModuleInfoCallbackCtx *callback_context =
- static_cast<ModuleInfoCallbackCtx *>(context);
+bool ModuleInfoCallback(const ModuleInfo& module_info, void* context) {
+ ModuleInfoCallbackCtx* callback_context =
+ static_cast<ModuleInfoCallbackCtx*>(context);
// Skip those modules without name, or those that are not modules.
if (strlen(module_info.name) == 0)
return true;
@@ -507,7 +507,7 @@ bool ModuleInfoCallback(const ModuleInfo &module_info, void *context) {
MDLocationDescriptor loc;
char path[PATH_MAX];
char buf[PATH_MAX];
- char *realname;
+ char* realname;
int count;
snprintf(path, sizeof (path), "/proc/self/path/%s", module_info.name);
@@ -535,9 +535,9 @@ bool ModuleInfoCallback(const ModuleInfo &module_info, void *context) {
return true;
}
-bool WriteModuleListStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteModuleListStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
TypedMDRVA<MDRawModuleList> list(minidump_writer);
int module_count = writer_args->lwp_lister->GetModuleCount();
@@ -558,9 +558,9 @@ bool WriteModuleListStream(MinidumpFileWriter *minidump_writer,
return writer_args->lwp_lister->ListModules(&callback) == module_count;
}
-bool WriteSystemInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteSystemInfoStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
TypedMDRVA<MDRawSystemInfo> sys_info(minidump_writer);
if (!sys_info.Allocate())
@@ -573,9 +573,9 @@ bool WriteSystemInfoStream(MinidumpFileWriter *minidump_writer,
WriteOSInformation(minidump_writer, sys_info.get());
}
-bool WriteExceptionStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteExceptionStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
// This happenes when this is not a crash, but a requested dump.
if (writer_args->sig_ctx == NULL)
return false;
@@ -620,14 +620,14 @@ bool WriteExceptionStream(MinidumpFileWriter *minidump_writer,
exception.get()->thread_context = context.location();
memset(context.get(), 0, sizeof(MDRawContextX86));
return WriteContext(context.get(),
- (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
+ (int*)&writer_args->sig_ctx->uc_mcontext.gregs,
NULL);
#endif
}
-bool WriteMiscInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteMiscInfoStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
TypedMDRVA<MDRawMiscInfo> info(minidump_writer);
if (!info.Allocate())
@@ -642,9 +642,9 @@ bool WriteMiscInfoStream(MinidumpFileWriter *minidump_writer,
return true;
}
-bool WriteBreakpadInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
+bool WriteBreakpadInfoStream(MinidumpFileWriter* minidump_writer,
+ const WriterArgument* writer_args,
+ MDRawDirectory* dir) {
TypedMDRVA<MDRawBreakpadInfo> info(minidump_writer);
if (!info.Allocate())
@@ -662,16 +662,16 @@ bool WriteBreakpadInfoStream(MinidumpFileWriter *minidump_writer,
class AutoLwpResumer {
public:
- AutoLwpResumer(SolarisLwp *lwp) : lwp_(lwp) {}
+ AutoLwpResumer(SolarisLwp* lwp) : lwp_(lwp) {}
~AutoLwpResumer() { lwp_->ControlAllLwps(false); }
private:
- SolarisLwp *lwp_;
+ SolarisLwp* lwp_;
};
// Prototype of writer functions.
-typedef bool (*WriteStreamFN)(MinidumpFileWriter *,
- const WriterArgument *,
- MDRawDirectory *);
+typedef bool (*WriteStreamFN)(MinidumpFileWriter*,
+ const WriterArgument*,
+ MDRawDirectory*);
// Function table to writer a full minidump.
const WriteStreamFN writers[] = {
@@ -684,9 +684,9 @@ const WriteStreamFN writers[] = {
};
// Will call each writer function in the writers table.
-//void* MinidumpGenerator::Write(void *argument) {
-void* Write(void *argument) {
- WriterArgument *writer_args = static_cast<WriterArgument *>(argument);
+//void* MinidumpGenerator::Write(void* argument) {
+void* Write(void* argument) {
+ WriterArgument* writer_args = static_cast<WriterArgument*>(argument);
if (!writer_args->lwp_lister->ControlAllLwps(true))
return NULL;
@@ -712,7 +712,7 @@ void* Write(void *argument) {
writer_args->crashed_lwpid = crashed_lwpid;
}
- MinidumpFileWriter *minidump_writer = writer_args->minidump_writer;
+ MinidumpFileWriter* minidump_writer = writer_args->minidump_writer;
TypedMDRVA<MDRawHeader> header(minidump_writer);
TypedMDRVA<MDRawDirectory> dir(minidump_writer);
if (!header.Allocate())
@@ -750,10 +750,10 @@ MinidumpGenerator::~MinidumpGenerator() {
// Write minidump into file.
// It runs in a different thread from the crashing thread.
-bool MinidumpGenerator::WriteMinidumpToFile(const char *file_pathname,
+bool MinidumpGenerator::WriteMinidumpToFile(const char* file_pathname,
int signo,
uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) const {
+ ucontext_t** sig_ctx) const {
// The exception handler thread.
pthread_t handler_thread;
@@ -775,7 +775,7 @@ bool MinidumpGenerator::WriteMinidumpToFile(const char *file_pathname,
argument.sighandler_ebp = sighandler_ebp;
argument.sig_ctx = NULL;
- pthread_create(&handler_thread, NULL, Write, (void *)&argument);
+ pthread_create(&handler_thread, NULL, Write, (void*)&argument);
pthread_join(handler_thread, NULL);
return true;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.h b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.h
index 882f9e1de5d..daa6fe01547 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_generator.h
@@ -48,10 +48,10 @@ namespace google_breakpad {
//
class MinidumpGenerator {
// Callback run for writing lwp information in the process.
- friend bool LwpInformationCallback(lwpstatus_t *lsp, void *context);
+ friend bool LwpInformationCallback(lwpstatus_t* lsp, void* context);
// Callback run for writing module information in the process.
- friend bool ModuleInfoCallback(const ModuleInfo &module_info, void *context);
+ friend bool ModuleInfoCallback(const ModuleInfo& module_info, void* context);
public:
MinidumpGenerator();
@@ -59,10 +59,10 @@ class MinidumpGenerator {
~MinidumpGenerator();
// Write minidump.
- bool WriteMinidumpToFile(const char *file_pathname,
+ bool WriteMinidumpToFile(const char* file_pathname,
int signo,
uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) const;
+ ucontext_t** sig_ctx) const;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_test.cc b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_test.cc
index 33302d86ab3..5f685ef24c5 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/minidump_test.cc
@@ -40,7 +40,7 @@ using google_breakpad::MinidumpGenerator;
static bool doneWritingReport = false;
-static void *Reporter(void *) {
+static void* Reporter(void*) {
char buffer[PATH_MAX];
MinidumpGenerator md;
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.cc b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.cc
index 0148997ad49..cb6cc8ab986 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.cc
@@ -69,10 +69,10 @@ struct AddressValidatingContext {
};
// Convert from string to int.
-static bool LocalAtoi(char *s, int *r) {
+static bool LocalAtoi(char* s, int* r) {
assert(s != NULL);
assert(r != NULL);
- char *endptr = NULL;
+ char* endptr = NULL;
int ret = strtol(s, &endptr, 10);
if (endptr == s)
return false;
@@ -82,10 +82,10 @@ static bool LocalAtoi(char *s, int *r) {
// Callback invoked for each mapped module.
// It uses the module's adderss range to validate the address.
-static bool AddressNotInModuleCallback(const ModuleInfo &module_info,
- void *context) {
- AddressValidatingContext *addr =
- reinterpret_cast<AddressValidatingContext *>(context);
+static bool AddressNotInModuleCallback(const ModuleInfo& module_info,
+ void* context) {
+ AddressValidatingContext* addr =
+ reinterpret_cast<AddressValidatingContext*>(context);
if (addr->is_mapped = ((module_info.start_addr > 0) &&
(addr->address >= module_info.start_addr) &&
(addr->address <= module_info.start_addr +
@@ -97,16 +97,16 @@ static bool AddressNotInModuleCallback(const ModuleInfo &module_info,
}
static int IterateLwpAll(int pid,
- CallbackParam<LwpidCallback> *callback_param) {
+ CallbackParam<LwpidCallback>* callback_param) {
char lwp_path[40];
- DIR *dir;
+ DIR* dir;
int count = 0;
snprintf(lwp_path, sizeof (lwp_path), "/proc/%d/lwp", (int)pid);
if ((dir = opendir(lwp_path)) == NULL)
return -1;
- struct dirent *entry = NULL;
+ struct dirent* entry = NULL;
while ((entry = readdir(dir)) != NULL) {
if ((strcmp(entry->d_name, ".") != 0) &&
(strcmp(entry->d_name, "..") != 0)) {
@@ -128,22 +128,22 @@ static int IterateLwpAll(int pid,
}
#if defined(__i386) && !defined(NO_FRAME_POINTER)
-void *GetNextFrame(void **last_ebp) {
- void *sp = *last_ebp;
+void* GetNextFrame(void** last_ebp) {
+ void* sp = *last_ebp;
if ((unsigned long)sp == (unsigned long)last_ebp)
return NULL;
- if ((unsigned long)sp & (sizeof(void *) - 1))
+ if ((unsigned long)sp & (sizeof(void*) - 1))
return NULL;
if ((unsigned long)sp - (unsigned long)last_ebp > 100000)
return NULL;
return sp;
}
#elif defined(__sparc)
-void *GetNextFrame(void *last_ebp) {
- return reinterpret_cast<struct frame *>(last_ebp)->fr_savfp;
+void* GetNextFrame(void* last_ebp) {
+ return reinterpret_cast<struct frame*>(last_ebp)->fr_savfp;
}
#else
-void *GetNextFrame(void **last_ebp) {
+void* GetNextFrame(void** last_ebp) {
return reinterpret_cast<void*>(last_ebp);
}
#endif
@@ -159,12 +159,12 @@ class AutoCloser {
// Control the execution of the lwp.
// Suspend/Resume lwp based on the value of context.
-static bool ControlLwp(int lwpid, void *context) {
+static bool ControlLwp(int lwpid, void* context) {
// The current thread is the one to handle the crash. Ignore it.
if (lwpid != pthread_self()) {
int ctlfd;
char procname[PATH_MAX];
- bool suspend = *(bool *)context;
+ bool suspend = *(bool*)context;
// Open the /proc/$pid/lwp/$lwpid/lwpctl files
snprintf(procname, sizeof (procname), "/proc/self/lwp/%d/lwpctl", lwpid);
@@ -193,7 +193,7 @@ static bool ControlLwp(int lwpid, void *context) {
* prheader_t at the start (/proc/$pid/lstatus or /proc/$pid/lpsinfo).
* Return true on success.
*/
-static bool read_lfile(int pid, const char *lname, prheader_t *lhp) {
+static bool read_lfile(int pid, const char* lname, prheader_t* lhp) {
char lpath[PATH_MAX];
struct stat statb;
int fd;
@@ -242,14 +242,14 @@ int SolarisLwp::GetLwpCount() const {
}
int SolarisLwp::Lwp_iter_all(int pid,
- CallbackParam<LwpCallback> *callback_param) const {
- lwpstatus_t *Lsp;
- lwpstatus_t *sp;
+ CallbackParam<LwpCallback>* callback_param) const {
+ lwpstatus_t* Lsp;
+ lwpstatus_t* sp;
prheader_t lphp[HEADER_MAX];
prheader_t lhp[HEADER_MAX];
- prheader_t *Lphp = lphp;
- prheader_t *Lhp = lhp;
- lwpsinfo_t *Lpsp;
+ prheader_t* Lphp = lphp;
+ prheader_t* Lhp = lhp;
+ lwpsinfo_t* Lpsp;
long nstat;
long ninfo;
int rv = 0;
@@ -264,13 +264,13 @@ int SolarisLwp::Lwp_iter_all(int pid,
return -1;
}
- Lsp = (lwpstatus_t *)(uintptr_t)(Lhp + 1);
- Lpsp = (lwpsinfo_t *)(uintptr_t)(Lphp + 1);
+ Lsp = (lwpstatus_t*)(uintptr_t)(Lhp + 1);
+ Lpsp = (lwpsinfo_t*)(uintptr_t)(Lphp + 1);
for (ninfo = Lphp->pr_nent; ninfo != 0; --ninfo) {
if (Lpsp->pr_sname != 'Z') {
sp = Lsp;
- Lsp = (lwpstatus_t *)((uintptr_t)Lsp + Lhp->pr_entsize);
+ Lsp = (lwpstatus_t*)((uintptr_t)Lsp + Lhp->pr_entsize);
} else {
sp = NULL;
}
@@ -278,7 +278,7 @@ int SolarisLwp::Lwp_iter_all(int pid,
!(callback_param->call_back)(sp, callback_param->context))
break;
++rv;
- Lpsp = (lwpsinfo_t *)((uintptr_t)Lpsp + Lphp->pr_entsize);
+ Lpsp = (lwpsinfo_t*)((uintptr_t)Lpsp + Lphp->pr_entsize);
}
return rv;
@@ -298,12 +298,12 @@ int SolarisLwp::GetModuleCount() const {
}
int SolarisLwp::ListModules(
- CallbackParam<ModuleCallback> *callback_param) const {
- const char *maps_path = "/proc/self/map";
+ CallbackParam<ModuleCallback>* callback_param) const {
+ const char* maps_path = "/proc/self/map";
struct stat status;
int fd = 0, num;
prmap_t map_array[MAP_MAX];
- prmap_t *maps = map_array;
+ prmap_t* maps = map_array;
size_t size;
if ((fd = open(maps_path, O_RDONLY)) == -1) {
@@ -326,12 +326,12 @@ int SolarisLwp::ListModules(
return -1;
}
- if (read(fd, (void *)maps, size) < 0) {
+ if (read(fd, (void*)maps, size) < 0) {
print_message2(2, "failed to read %d\n", fd);
return -1;
}
- prmap_t *_maps;
+ prmap_t* _maps;
int _num;
int module_count = 0;
@@ -345,7 +345,7 @@ int SolarisLwp::ListModules(
*/
for (_num = 0, _maps = maps; _num < num; ++_num, ++_maps) {
ModuleInfo module;
- char *name = _maps->pr_mapname;
+ char* name = _maps->pr_mapname;
memset(&module, 0, sizeof (module));
module.start_addr = _maps->pr_vaddr;
@@ -403,7 +403,7 @@ bool SolarisLwp::IsAddressMapped(uintptr_t address) const {
// The Solaris stack looks like this:
// http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libproc/common/Pstack.c#81
bool SolarisLwp::FindSigContext(uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) {
+ ucontext_t** sig_ctx) {
uintptr_t previous_ebp;
uintptr_t sig_ebp;
const int MAX_STACK_DEPTH = 50;
@@ -416,7 +416,7 @@ bool SolarisLwp::FindSigContext(uintptr_t sighandler_ebp,
*sig_ctx = reinterpret_cast<ucontext_t*>(sighandler_ebp + sizeof (struct frame));
uintptr_t sig_esp = (*sig_ctx)->uc_mcontext.gregs[REG_O6];
if (sig_esp < previous_ebp && sig_esp > sighandler_ebp)
- sig_ebp = (uintptr_t)(((struct frame *)sig_esp)->fr_savfp);
+ sig_ebp = (uintptr_t)(((struct frame*)sig_esp)->fr_savfp);
#elif TARGET_CPU_X86
previous_ebp = reinterpret_cast<uintptr_t>(GetNextFrame(
diff --git a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.h b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.h
index 0914cfcd87b..afe352ce62f 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/solaris/handler/solaris_lwp.h
@@ -70,17 +70,17 @@ struct ModuleInfo {
// A callback to run when getting a lwp in the process.
// Return true will go on to the next lwp while return false will stop the
// iteration.
-typedef bool (*LwpCallback)(lwpstatus_t* lsp, void *context);
+typedef bool (*LwpCallback)(lwpstatus_t* lsp, void* context);
// A callback to run when a new module is found in the process.
// Return true will go on to the next module while return false will stop the
// iteration.
-typedef bool (*ModuleCallback)(const ModuleInfo &module_info, void *context);
+typedef bool (*ModuleCallback)(const ModuleInfo& module_info, void* context);
// A callback to run when getting a lwpid in the process.
// Return true will go on to the next lwp while return false will stop the
// iteration.
-typedef bool (*LwpidCallback)(int lwpid, void *context);
+typedef bool (*LwpidCallback)(int lwpid, void* context);
// Holding the callback information.
template<class CallbackFunc>
@@ -88,12 +88,12 @@ struct CallbackParam {
// Callback function address.
CallbackFunc call_back;
// Callback context;
- void *context;
+ void* context;
CallbackParam() : call_back(NULL), context(NULL) {
}
- CallbackParam(CallbackFunc func, void *func_context) :
+ CallbackParam(CallbackFunc func, void* func_context) :
call_back(func), context(func_context) {
}
};
@@ -129,7 +129,7 @@ class SolarisLwp {
// Whenever there is a lwp found, the callback will be invoked to process
// the information.
// Return the callback return value or -1 on error.
- int Lwp_iter_all(int pid, CallbackParam<LwpCallback> *callback_param) const;
+ int Lwp_iter_all(int pid, CallbackParam<LwpCallback>* callback_param) const;
// Get the module count of the current process.
int GetModuleCount() const;
@@ -138,13 +138,13 @@ class SolarisLwp {
// Whenever a module is found, the callback will be invoked to process the
// information.
// Return how may modules are found.
- int ListModules(CallbackParam<ModuleCallback> *callback_param) const;
+ int ListModules(CallbackParam<ModuleCallback>* callback_param) const;
// Get the bottom of the stack from esp.
uintptr_t GetLwpStackBottom(uintptr_t current_esp) const;
// Finds a signal context on the stack given the ebp of our signal handler.
- bool FindSigContext(uintptr_t sighandler_ebp, ucontext_t **sig_ctx);
+ bool FindSigContext(uintptr_t sighandler_ebp, ucontext_t** sig_ctx);
private:
// Check if the address is a valid virtual address.
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc
index ad45b2000b5..20d63a84136 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.cc
@@ -118,7 +118,7 @@ ExceptionHandler::ExceptionHandler(
NULL); // custom_info - not used
}
-ExceptionHandler::ExceptionHandler(const wstring &dump_path,
+ExceptionHandler::ExceptionHandler(const wstring& dump_path,
FilterCallback filter,
MinidumpCallback callback,
void* callback_context,
@@ -383,7 +383,7 @@ bool ExceptionHandler::RequestUpload(DWORD crash_id) {
// static
DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
- ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);
+ ExceptionHandler* self = reinterpret_cast<ExceptionHandler*>(lpParameter);
assert(self);
assert(self->handler_start_semaphore_ != NULL);
assert(self->handler_finish_semaphore_ != NULL);
@@ -765,7 +765,7 @@ bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) {
}
// static
-bool ExceptionHandler::WriteMinidump(const wstring &dump_path,
+bool ExceptionHandler::WriteMinidump(const wstring& dump_path,
MinidumpCallback callback,
void* callback_context,
MINIDUMP_TYPE dump_type) {
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.h b/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.h
index 11babe513ec..eb5adaac588 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/handler/exception_handler.h
@@ -218,7 +218,7 @@ class ExceptionHandler {
// Get and set the minidump path.
wstring dump_path() const { return dump_path_; }
- void set_dump_path(const wstring &dump_path) {
+ void set_dump_path(const wstring& dump_path) {
dump_path_ = dump_path;
dump_path_c_ = dump_path_.c_str();
UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_.
@@ -237,7 +237,7 @@ class ExceptionHandler {
// Convenience form of WriteMinidump which does not require an
// ExceptionHandler instance.
- static bool WriteMinidump(const wstring &dump_path,
+ static bool WriteMinidump(const wstring& dump_path,
MinidumpCallback callback, void* callback_context,
MINIDUMP_TYPE dump_type = MiniDumpNormal);
@@ -513,8 +513,8 @@ class ExceptionHandler {
static volatile LONG instance_count_;
// disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
+ explicit ExceptionHandler(const ExceptionHandler&);
+ void operator=(const ExceptionHandler&);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.cc
index eb2b422af83..7fc6448392e 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.cc
@@ -45,12 +45,12 @@ namespace google_breakpad {
static const char kCheckpointSignature[] = "GBP1\n";
-CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
+CrashReportSender::CrashReportSender(const wstring& checkpoint_file)
: checkpoint_file_(checkpoint_file),
max_reports_per_day_(-1),
last_sent_date_(-1),
reports_sent_(0) {
- FILE *fd;
+ FILE* fd;
if (OpenCheckpointFile(L"r", &fd) == 0) {
ReadCheckpoint(fd);
fclose(fd);
@@ -58,8 +58,8 @@ CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
}
ReportResult CrashReportSender::SendCrashReport(
- const wstring &url, const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files, wstring *report_code) {
+ const wstring& url, const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files, wstring* report_code) {
int today = GetCurrentDate();
if (today == last_sent_date_ &&
max_reports_per_day_ != -1 &&
@@ -82,7 +82,7 @@ ReportResult CrashReportSender::SendCrashReport(
}
}
-void CrashReportSender::ReadCheckpoint(FILE *fd) {
+void CrashReportSender::ReadCheckpoint(FILE* fd) {
char buf[128];
if (!fgets(buf, sizeof(buf), fd) ||
strcmp(buf, kCheckpointSignature) != 0) {
@@ -108,7 +108,7 @@ void CrashReportSender::ReportSent(int today) {
++reports_sent_;
// Update the checkpoint file
- FILE *fd;
+ FILE* fd;
if (OpenCheckpointFile(L"w", &fd) == 0) {
fputs(kCheckpointSignature, fd);
fprintf(fd, "%d\n", last_sent_date_);
@@ -124,7 +124,7 @@ int CrashReportSender::GetCurrentDate() const {
system_time.wDay;
}
-int CrashReportSender::OpenCheckpointFile(const wchar_t *mode, FILE **fd) {
+int CrashReportSender::OpenCheckpointFile(const wchar_t* mode, FILE** fd) {
if (checkpoint_file_.empty()) {
return ENOENT;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.h b/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.h
index 7786cc699c1..e6055857c6d 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.h
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/sender/crash_report_sender.h
@@ -65,7 +65,7 @@ class CrashReportSender {
// If checkpoint_file is non-empty, breakpad will persist crash report
// state to this file. A checkpoint file is required for
// set_max_reports_per_day() to function properly.
- explicit CrashReportSender(const wstring &checkpoint_file);
+ explicit CrashReportSender(const wstring& checkpoint_file);
~CrashReportSender() {}
// Sets the maximum number of crash reports that will be sent in a 24-hour
@@ -87,14 +87,14 @@ class CrashReportSender {
// the return value is RESULT_SUCCEEDED), a code uniquely identifying the
// report will be returned in report_code.
// (Otherwise, report_code will be unchanged.)
- ReportResult SendCrashReport(const wstring &url,
- const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- wstring *report_code);
+ ReportResult SendCrashReport(const wstring& url,
+ const map<wstring, wstring>& parameters,
+ const map<wstring, wstring>& files,
+ wstring* report_code);
private:
// Reads persistent state from a checkpoint file.
- void ReadCheckpoint(FILE *fd);
+ void ReadCheckpoint(FILE* fd);
// Called when a new report has been sent, to update the checkpoint state.
void ReportSent(int today);
@@ -104,7 +104,7 @@ class CrashReportSender {
// Opens the checkpoint file with the specified mode.
// Returns zero on success, or an error code on failure.
- int OpenCheckpointFile(const wchar_t *mode, FILE **fd);
+ int OpenCheckpointFile(const wchar_t* mode, FILE** fd);
wstring checkpoint_file_;
int max_reports_per_day_;
@@ -114,8 +114,8 @@ class CrashReportSender {
int reports_sent_;
// Disallow copy constructor and operator=
- explicit CrashReportSender(const CrashReportSender &);
- void operator=(const CrashReportSender &);
+ explicit CrashReportSender(const CrashReportSender&);
+ void operator=(const CrashReportSender&);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/dump_analysis.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/dump_analysis.cc
index 53d4ddbde98..0bb8f6c461f 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/dump_analysis.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/dump_analysis.cc
@@ -127,8 +127,8 @@ size_t DumpAnalysis::GetStreamImpl(ULONG stream_number, void** stream) const {
return ret ? memory_list_size : 0;
}
-bool DumpAnalysis::HasMemoryImpl(const void *addr_in, size_t structuresize,
- void **structure) const {
+bool DumpAnalysis::HasMemoryImpl(const void* addr_in, size_t structuresize,
+ void** structure) const {
uintptr_t address = reinterpret_cast<uintptr_t>(addr_in);
MINIDUMP_MEMORY_LIST* memory_list = NULL;
size_t memory_list_size = GetStream(MemoryListStream, &memory_list);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_death_test.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_death_test.cc
index 5ef9e64d1dd..04034e8d443 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_death_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_death_test.cc
@@ -52,7 +52,7 @@ const char kSuccessIndicator[] = "success";
const char kFailureIndicator[] = "failure";
// Utility function to test for a path's existence.
-BOOL DoesPathExist(const TCHAR *path_name);
+BOOL DoesPathExist(const TCHAR* path_name);
enum OutOfProcGuarantee {
OUT_OF_PROC_GUARANTEED,
@@ -92,7 +92,7 @@ void ExceptionHandlerDeathTest::SetUp() {
CreateDirectory(temp_path_, NULL);
}
-BOOL DoesPathExist(const TCHAR *path_name) {
+BOOL DoesPathExist(const TCHAR* path_name) {
DWORD flags = GetFileAttributes(path_name);
if (flags == INVALID_FILE_ATTRIBUTES) {
return FALSE;
@@ -135,15 +135,15 @@ TEST_F(ExceptionHandlerDeathTest, InProcTest) {
// Disable GTest SEH handler
testing::DisableExceptionHandlerInScope disable_exception_handler;
- int *i = NULL;
+ int* i = NULL;
ASSERT_DEATH((*i)++, kSuccessIndicator);
}
static bool gDumpCallbackCalled = false;
-void clientDumpCallback(void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const std::wstring *dump_path) {
+void clientDumpCallback(void* dump_context,
+ const google_breakpad::ClientInfo* client_info,
+ const std::wstring* dump_path) {
gDumpCallbackCalled = true;
}
@@ -152,7 +152,7 @@ void ExceptionHandlerDeathTest::DoCrashAccessViolation(
scoped_ptr<google_breakpad::ExceptionHandler> exc;
if (out_of_proc_guarantee == OUT_OF_PROC_GUARANTEED) {
- google_breakpad::CrashGenerationClient *client =
+ google_breakpad::CrashGenerationClient* client =
new google_breakpad::CrashGenerationClient(kPipeName,
MiniDumpNormal,
NULL); // custom_info
@@ -184,7 +184,7 @@ void ExceptionHandlerDeathTest::DoCrashAccessViolation(
// if it's not true we'll still get an error rather than the crash
// being expected.
ASSERT_TRUE(exc->IsOutOfProcess());
- int *i = NULL;
+ int* i = NULL;
printf("%d\n", (*i)++);
}
@@ -283,7 +283,7 @@ TEST_F(ExceptionHandlerDeathTest, PureVirtualCallTest) {
EXPECT_EXIT(DoCrashPureVirtualCall(), ::testing::ExitedWithCode(0), "");
}
-wstring find_minidump_in_directory(const wstring &directory) {
+wstring find_minidump_in_directory(const wstring& directory) {
wstring search_path = directory + L"\\*";
WIN32_FIND_DATA find_data;
HANDLE find_handle = FindFirstFileW(search_path.c_str(), &find_data);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
index 3ae1d7cd052..e24bd18b6e9 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
@@ -49,7 +49,7 @@ const char kFilterReturnsFalse[] = "filter_returns_false";
const char kCallbackReturnsTrue[] = "callback_returns_true";
const char kCallbackReturnsFalse[] = "callback_returns_false";
-bool DoesPathExist(const wchar_t *path_name) {
+bool DoesPathExist(const wchar_t* path_name) {
DWORD flags = GetFileAttributes(path_name);
if (flags == INVALID_FILE_ATTRIBUTES) {
return false;
@@ -128,12 +128,12 @@ bool MinidumpWrittenCallback(const wchar_t* dump_path,
}
-void DoCrash(const char *message) {
+void DoCrash(const char* message) {
if (message) {
fprintf(stderr, "%s", message);
fflush(stderr);
}
- int *i = NULL;
+ int* i = NULL;
(*i)++;
ASSERT_TRUE(false);
diff --git a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_test.cc b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_test.cc
index a4ce12a8aad..51196ca0694 100644
--- a/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_test.cc
+++ b/chromium/third_party/breakpad/breakpad/src/client/windows/unittests/exception_handler_test.cc
@@ -87,13 +87,13 @@ class ExceptionHandlerTest : public ::testing::Test {
void DoCrashPureVirtualCall();
// Utility function to test for a path's existence.
- static BOOL DoesPathExist(const TCHAR *path_name);
+ static BOOL DoesPathExist(const TCHAR* path_name);
// Client callback.
static void ClientDumpCallback(
- void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const std::wstring *dump_path);
+ void* dump_context,
+ const google_breakpad::ClientInfo* client_info,
+ const std::wstring* dump_path);
static bool DumpCallback(const wchar_t* dump_path,
const wchar_t* minidump_id,
@@ -141,7 +141,7 @@ void ExceptionHandlerTest::TearDown() {
}
}
-BOOL ExceptionHandlerTest::DoesPathExist(const TCHAR *path_name) {
+BOOL ExceptionHandlerTest::DoesPathExist(const TCHAR* path_name) {
DWORD flags = GetFileAttributes(path_name);
if (flags == INVALID_FILE_ATTRIBUTES) {
return FALSE;
@@ -151,9 +151,9 @@ BOOL ExceptionHandlerTest::DoesPathExist(const TCHAR *path_name) {
// static
void ExceptionHandlerTest::ClientDumpCallback(
- void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const wstring *dump_path) {
+ void* dump_context,
+ const google_breakpad::ClientInfo* client_info,
+ const wstring* dump_path) {
dump_file = *dump_path;
// Create the full dump file name from the dump path.
full_dump_file = dump_file.substr(0, dump_file.length() - 4) + L"-full.dmp";
@@ -174,7 +174,7 @@ bool ExceptionHandlerTest::DumpCallback(const wchar_t* dump_path,
}
void ExceptionHandlerTest::DoCrashInvalidParameter() {
- google_breakpad::ExceptionHandler *exc =
+ google_breakpad::ExceptionHandler* exc =
new google_breakpad::ExceptionHandler(
temp_path_, NULL, NULL, NULL,
google_breakpad::ExceptionHandler::HANDLER_INVALID_PARAMETER,
@@ -206,7 +206,7 @@ struct PureVirtualCall : public PureVirtualCallBase {
};
void ExceptionHandlerTest::DoCrashPureVirtualCall() {
- google_breakpad::ExceptionHandler *exc =
+ google_breakpad::ExceptionHandler* exc =
new google_breakpad::ExceptionHandler(
temp_path_, NULL, NULL, NULL,
google_breakpad::ExceptionHandler::HANDLER_PURECALL,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/android/testing/pthread_fixes.h b/chromium/third_party/breakpad/breakpad/src/common/android/testing/pthread_fixes.h
index 20c1208480d..b0a3d82e4b0 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/android/testing/pthread_fixes.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/android/testing/pthread_fixes.h
@@ -80,7 +80,7 @@ int pthread_barrier_wait(pthread_barrier_t* barrier) {
return 0;
}
-int pthread_barrier_destroy(pthread_barrier_t *barrier) {
+int pthread_barrier_destroy(pthread_barrier_t* barrier) {
barrier->count = 0;
pthread_cond_destroy(&barrier->cond);
pthread_mutex_destroy(&barrier->mutex);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/byte_cursor.h b/chromium/third_party/breakpad/breakpad/src/common/byte_cursor.h
index accd54e0a41..28bb8e767d5 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/byte_cursor.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/byte_cursor.h
@@ -52,16 +52,16 @@ namespace google_breakpad {
// A buffer holding a series of bytes.
struct ByteBuffer {
ByteBuffer() : start(0), end(0) { }
- ByteBuffer(const uint8_t *set_start, size_t set_size)
+ ByteBuffer(const uint8_t* set_start, size_t set_size)
: start(set_start), end(set_start + set_size) { }
~ByteBuffer() { };
// Equality operators. Useful in unit tests, and when we're using
// ByteBuffers to refer to regions of a larger buffer.
- bool operator==(const ByteBuffer &that) const {
+ bool operator==(const ByteBuffer& that) const {
return start == that.start && end == that.end;
}
- bool operator!=(const ByteBuffer &that) const {
+ bool operator!=(const ByteBuffer& that) const {
return start != that.start || end != that.end;
}
@@ -71,7 +71,8 @@ struct ByteBuffer {
return end - start;
}
- const uint8_t *start, *end;
+ const uint8_t* start;
+ const uint8_t* end;
};
// A cursor pointing into a ByteBuffer that can parse numbers of various
@@ -82,8 +83,8 @@ class ByteCursor {
public:
// Create a cursor reading bytes from the start of BUFFER. By default, the
// cursor reads multi-byte values in little-endian form.
- ByteCursor(const ByteBuffer *buffer, bool big_endian = false)
- : buffer_(buffer), here_(buffer->start),
+ ByteCursor(const ByteBuffer* buffer, bool big_endian = false)
+ : buffer_(buffer), here_(buffer->start),
big_endian_(big_endian), complete_(true) { }
// Accessor and setter for this cursor's endianness flag.
@@ -92,8 +93,8 @@ class ByteCursor {
// Accessor and setter for this cursor's current position. The setter
// returns a reference to this cursor.
- const uint8_t *here() const { return here_; }
- ByteCursor &set_here(const uint8_t *here) {
+ const uint8_t* here() const { return here_; }
+ ByteCursor& set_here(const uint8_t* here) {
assert(buffer_->start <= here && here <= buffer_->end);
here_ = here;
return *this;
@@ -116,7 +117,7 @@ class ByteCursor {
// this cursor's complete_ flag, and store a dummy value in *RESULT.
// Return a reference to this cursor.
template<typename T>
- ByteCursor &Read(size_t size, bool is_signed, T *result) {
+ ByteCursor& Read(size_t size, bool is_signed, T* result) {
if (CheckAvailable(size)) {
T v = 0;
if (big_endian_) {
@@ -145,7 +146,7 @@ class ByteCursor {
// read off the end of our buffer, clear this cursor's complete_ flag.
// Return a reference to this cursor.
template<typename T>
- ByteCursor &operator>>(T &result) {
+ ByteCursor& operator>>(T& result) {
bool T_is_signed = (T)-1 < 0;
return Read(sizeof(T), T_is_signed, &result);
}
@@ -154,7 +155,7 @@ class ByteCursor {
// cursor to the end of them. If we read off the end of our buffer,
// clear this cursor's complete_ flag, and set *POINTER to NULL.
// Return a reference to this cursor.
- ByteCursor &Read(uint8_t *buffer, size_t size) {
+ ByteCursor& Read(uint8_t* buffer, size_t size) {
if (CheckAvailable(size)) {
memcpy(buffer, here_, size);
here_ += size;
@@ -166,11 +167,11 @@ class ByteCursor {
// byte buffer does not contain a terminating zero, clear this cursor's
// complete_ flag, and set STR to the empty string. Return a reference to
// this cursor.
- ByteCursor &CString(string *str) {
- const uint8_t *end
- = static_cast<const uint8_t *>(memchr(here_, '\0', Available()));
+ ByteCursor& CString(string* str) {
+ const uint8_t* end
+ = static_cast<const uint8_t*>(memchr(here_, '\0', Available()));
if (end) {
- str->assign(reinterpret_cast<const char *>(here_), end - here_);
+ str->assign(reinterpret_cast<const char*>(here_), end - here_);
here_ = end + 1;
} else {
str->clear();
@@ -193,14 +194,14 @@ class ByteCursor {
//
// - Otherwise, set *STR to a copy of those LIMIT bytes, and advance the
// cursor by LIMIT bytes.
- ByteCursor &CString(string *str, size_t limit) {
+ ByteCursor& CString(string* str, size_t limit) {
if (CheckAvailable(limit)) {
- const uint8_t *end
- = static_cast<const uint8_t *>(memchr(here_, '\0', limit));
+ const uint8_t* end
+ = static_cast<const uint8_t*>(memchr(here_, '\0', limit));
if (end)
- str->assign(reinterpret_cast<const char *>(here_), end - here_);
+ str->assign(reinterpret_cast<const char*>(here_), end - here_);
else
- str->assign(reinterpret_cast<const char *>(here_), limit);
+ str->assign(reinterpret_cast<const char*>(here_), limit);
here_ += limit;
} else {
str->clear();
@@ -213,7 +214,7 @@ class ByteCursor {
// cursor. If we read off the end of our buffer, clear this cursor's
// complete_ flag, and set *POINTER to NULL. Return a reference to this
// cursor.
- ByteCursor &PointTo(const uint8_t **pointer, size_t size = 0) {
+ ByteCursor& PointTo(const uint8_t** pointer, size_t size = 0) {
if (CheckAvailable(size)) {
*pointer = here_;
here_ += size;
@@ -226,7 +227,7 @@ class ByteCursor {
// Skip SIZE bytes at the cursor. If doing so would advance us off
// the end of our buffer, clear this cursor's complete_ flag, and
// set *POINTER to NULL. Return a reference to this cursor.
- ByteCursor &Skip(size_t size) {
+ ByteCursor& Skip(size_t size) {
if (CheckAvailable(size))
here_ += size;
return *this;
@@ -247,10 +248,10 @@ class ByteCursor {
}
// The buffer we're reading bytes from.
- const ByteBuffer *buffer_;
+ const ByteBuffer* buffer_;
// The next byte within buffer_ that we'll read.
- const uint8_t *here_;
+ const uint8_t* here_;
// True if we should read numbers in big-endian form; false if we
// should read in little-endian form.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/byte_cursor_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/byte_cursor_unittest.cc
index 06bfd89d739..45e6f2b4ba2 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/byte_cursor_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/byte_cursor_unittest.cc
@@ -593,7 +593,7 @@ TEST(Extractor, Signed4) {
int32_t a;
// For some reason, G++ 4.4.1 complains:
// warning: array subscript is above array bounds
- // in ByteCursor::Read(size_t, bool, T *) as it inlines this call, but
+ // in ByteCursor::Read(size_t, bool, T*) as it inlines this call, but
// I'm not able to see how such a reference would occur.
EXPECT_TRUE(cursor >> a);
EXPECT_EQ(-380377902, a);
@@ -627,7 +627,7 @@ TEST(Extractor, Unsigned4) {
uint32_t a;
// For some reason, G++ 4.4.1 complains:
// warning: array subscript is above array bounds
- // in ByteCursor::Read(size_t, bool, T *) as it inlines this call, but
+ // in ByteCursor::Read(size_t, bool, T*) as it inlines this call, but
// I'm not able to see how such a reference would occur.
EXPECT_TRUE(cursor >> a);
EXPECT_EQ(0xe953e4d2, a);
@@ -718,10 +718,10 @@ TEST(Strings, PointTo) {
ByteBuffer buffer(data, sizeof(data));
ByteCursor cursor(&buffer);
- const uint8_t *received1;
- const uint8_t *received2;
- const uint8_t *received3;
- const uint8_t *received4;
+ const uint8_t* received1;
+ const uint8_t* received2;
+ const uint8_t* received3;
+ const uint8_t* received4;
EXPECT_FALSE(cursor
.PointTo(&received1, 3)
.PointTo(&received2, 3)
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader-inl.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader-inl.h
index f4c068a2afc..448be23763f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader-inl.h
@@ -36,11 +36,11 @@
namespace dwarf2reader {
-inline uint8_t ByteReader::ReadOneByte(const uint8_t *buffer) const {
+inline uint8_t ByteReader::ReadOneByte(const uint8_t* buffer) const {
return buffer[0];
}
-inline uint16_t ByteReader::ReadTwoBytes(const uint8_t *buffer) const {
+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) {
@@ -50,7 +50,18 @@ inline uint16_t ByteReader::ReadTwoBytes(const uint8_t *buffer) const {
}
}
-inline uint64_t ByteReader::ReadFourBytes(const uint8_t *buffer) const {
+inline uint64_t ByteReader::ReadThreeBytes(const uint8_t* buffer) const {
+ const uint32_t buffer0 = buffer[0];
+ const uint32_t buffer1 = buffer[1];
+ const uint32_t buffer2 = buffer[2];
+ if (endian_ == ENDIANNESS_LITTLE) {
+ return buffer0 | buffer1 << 8 | buffer2 << 16;
+ } else {
+ return buffer2 | buffer1 << 8 | buffer0 << 16;
+ }
+}
+
+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];
@@ -62,7 +73,7 @@ inline uint64_t ByteReader::ReadFourBytes(const uint8_t *buffer) const {
}
}
-inline uint64_t ByteReader::ReadEightBytes(const uint8_t *buffer) const {
+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];
@@ -84,7 +95,7 @@ inline uint64_t ByteReader::ReadEightBytes(const uint8_t *buffer) const {
// information, plus one bit saying whether the number continues or
// not.
-inline uint64_t ByteReader::ReadUnsignedLEB128(const uint8_t *buffer,
+inline uint64_t ByteReader::ReadUnsignedLEB128(const uint8_t* buffer,
size_t* len) const {
uint64_t result = 0;
size_t num_read = 0;
@@ -109,7 +120,7 @@ inline uint64_t ByteReader::ReadUnsignedLEB128(const uint8_t *buffer,
// Read a signed LEB128 number. These are like regular LEB128
// numbers, except the last byte may have a sign bit set.
-inline int64_t ByteReader::ReadSignedLEB128(const uint8_t *buffer,
+inline int64_t ByteReader::ReadSignedLEB128(const uint8_t* buffer,
size_t* len) const {
int64_t result = 0;
unsigned int shift = 0;
@@ -129,18 +140,18 @@ inline int64_t ByteReader::ReadSignedLEB128(const uint8_t *buffer,
return result;
}
-inline uint64_t ByteReader::ReadOffset(const uint8_t *buffer) const {
+inline uint64_t ByteReader::ReadOffset(const uint8_t* buffer) const {
assert(this->offset_reader_);
return (this->*offset_reader_)(buffer);
}
-inline uint64_t ByteReader::ReadAddress(const uint8_t *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_t section_base,
- const uint8_t *buffer_base) {
+ const uint8_t* buffer_base) {
section_base_ = section_base;
buffer_base_ = buffer_base;
have_section_base_ = true;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.cc
index 0b27dd58a7e..ac5064a77c2 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.cc
@@ -63,7 +63,7 @@ void ByteReader::SetAddressSize(uint8_t size) {
}
}
-uint64_t ByteReader::ReadInitialLength(const uint8_t *start, size_t* len) {
+uint64_t ByteReader::ReadInitialLength(const uint8_t* start, size_t* len) {
const uint64_t initial_length = ReadFourBytes(start);
start += 4;
@@ -101,9 +101,9 @@ bool ByteReader::UsableEncoding(DwarfPointerEncoding encoding) const {
}
}
-uint64_t ByteReader::ReadEncodedPointer(const uint8_t *buffer,
+uint64_t ByteReader::ReadEncodedPointer(const uint8_t* buffer,
DwarfPointerEncoding encoding,
- size_t *len) const {
+ size_t* len) const {
// UsableEncoding doesn't approve of DW_EH_PE_omit, so we shouldn't
// see it here.
assert(encoding != DW_EH_PE_omit);
@@ -130,7 +130,7 @@ uint64_t ByteReader::ReadEncodedPointer(const uint8_t *buffer,
// Round up to the next boundary.
uint64_t aligned = (offset + AddressSize() - 1) & -AddressSize();
// Convert back to a pointer.
- const uint8_t *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);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.h
index 2b37a12dd19..5d7a9a7fb3d 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader.h
@@ -62,22 +62,27 @@ class ByteReader {
// Read a single byte from BUFFER and return it as an unsigned 8 bit
// number.
- uint8_t ReadOneByte(const uint8_t *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_t ReadTwoBytes(const uint8_t *buffer) const;
+ uint16_t ReadTwoBytes(const uint8_t* buffer) const;
+
+ // Read three bytes from BUFFER and return them as an unsigned 64 bit
+ // number, using this ByteReader's endianness. DWARF 5 uses this encoding
+ // for various index-related DW_FORMs.
+ uint64_t ReadThreeBytes(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_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_t ReadFourBytes(const uint8_t *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_t ReadEightBytes(const uint8_t *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
@@ -96,7 +101,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_t ReadUnsignedLEB128(const uint8_t *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.
@@ -115,7 +120,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_t ReadSignedLEB128(const uint8_t *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
@@ -138,7 +143,7 @@ class ByteReader {
// 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_t ReadAddress(const uint8_t *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
@@ -175,14 +180,14 @@ 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_t ReadInitialLength(const uint8_t *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_t ReadOffset(const uint8_t *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.
@@ -237,7 +242,7 @@ 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_t section_base, const uint8_t *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.
@@ -276,15 +281,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_t ReadEncodedPointer(const uint8_t *buffer,
+ uint64_t ReadEncodedPointer(const uint8_t* buffer,
DwarfPointerEncoding encoding,
- size_t *len) const;
+ size_t* len) const;
Endianness GetEndianness() const;
private:
// Function pointer type for our address and offset readers.
- typedef uint64_t (ByteReader::*AddressReader)(const uint8_t *) 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,
@@ -307,7 +312,7 @@ class ByteReader {
bool have_section_base_, have_text_base_, have_data_base_;
bool have_function_base_;
uint64_t section_base_, text_base_, data_base_, function_base_;
- const uint8_t *buffer_base_;
+ const uint8_t* buffer_base_;
};
} // namespace dwarf2reader
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader_unittest.cc
index e66062d1fe4..3d7924b9cc9 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/bytereader_unittest.cc
@@ -73,7 +73,7 @@ TEST_F(Reader, SimpleConstructor) {
.LEB128(-0x4f337badf4483f83LL)
.D32(0xfec319c9);
ASSERT_TRUE(section.GetContents(&contents));
- const uint8_t *data = reinterpret_cast<const uint8_t *>(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));
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.cc
index 2dc2208577b..858fd56181e 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.cc
@@ -41,11 +41,11 @@ namespace google_breakpad {
using dwarf2reader::DwarfPointerEncoding;
-CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor,
+CFISection& CFISection::CIEHeader(uint64_t code_alignment_factor,
int data_alignment_factor,
unsigned return_address_register,
uint8_t version,
- const string &augmentation,
+ const string& augmentation,
bool dwarf64,
uint8_t address_size,
uint8_t segment_size) {
@@ -78,7 +78,7 @@ CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor,
return *this;
}
-CFISection &CFISection::FDEHeader(Label cie_pointer,
+CFISection& CFISection::FDEHeader(Label cie_pointer,
uint64_t initial_location,
uint64_t address_range,
bool dwarf64) {
@@ -113,7 +113,7 @@ CFISection &CFISection::FDEHeader(Label cie_pointer,
return *this;
}
-CFISection &CFISection::FinishEntry() {
+CFISection& CFISection::FinishEntry() {
assert(entry_length_);
Align(address_size_, dwarf2reader::DW_CFA_nop);
entry_length_->length = Here() - entry_length_->start;
@@ -123,9 +123,9 @@ CFISection &CFISection::FinishEntry() {
return *this;
}
-CFISection &CFISection::EncodedPointer(uint64_t address,
+CFISection& CFISection::EncodedPointer(uint64_t address,
DwarfPointerEncoding encoding,
- const EncodedPointerBases &bases) {
+ const EncodedPointerBases& bases) {
// Omitted data is extremely easy to emit.
if (encoding == dwarf2reader::DW_EH_PE_omit)
return *this;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.h
index bd7354d1275..d60ecc9e2f9 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/cfi_assembler.h
@@ -120,7 +120,7 @@ class CFISection: public Section {
// Use the addresses in BASES as the base addresses for encoded
// pointers in subsequent calls to FDEHeader or EncodedPointer.
// This function makes a copy of BASES.
- void SetEncodedPointerBases(const EncodedPointerBases &bases) {
+ void SetEncodedPointerBases(const EncodedPointerBases& bases) {
encoded_pointer_bases_ = bases;
}
@@ -133,11 +133,11 @@ class CFISection: public Section {
// Before calling this function, you will typically want to use Mark
// or Here to make a label to pass to FDEHeader that refers to this
// CIE's position in the section.
- CFISection &CIEHeader(uint64_t code_alignment_factor,
+ CFISection& CIEHeader(uint64_t code_alignment_factor,
int data_alignment_factor,
unsigned return_address_register,
uint8_t version = 3,
- const string &augmentation = "",
+ const string& augmentation = "",
bool dwarf64 = false,
uint8_t address_size = 8,
uint8_t segment_size = 0);
@@ -152,7 +152,7 @@ class CFISection: public Section {
// 0xffffff00 bytes. (The "initial length" is always a 32-bit
// value.) Nor does it support .debug_frame sections longer than
// 0xffffff00 bytes.
- CFISection &FDEHeader(Label cie_pointer,
+ CFISection& FDEHeader(Label cie_pointer,
uint64_t initial_location,
uint64_t address_range,
bool dwarf64 = false);
@@ -161,11 +161,11 @@ class CFISection: public Section {
// started, after padding with DW_CFA_nops for alignment. This
// defines the label representing the entry's length, cited in the
// entry's header. Return a reference to this section.
- CFISection &FinishEntry();
+ CFISection& FinishEntry();
// Append the contents of BLOCK as a DW_FORM_block value: an
// unsigned LEB128 length, followed by that many bytes of data.
- CFISection &Block(const string &block) {
+ CFISection& Block(const string& block) {
ULEB128(block.size());
Append(block);
return *this;
@@ -173,11 +173,11 @@ class CFISection: public Section {
// Append ADDRESS to this section, in the appropriate size and
// endianness. Return a reference to this section.
- CFISection &Address(uint64_t address) {
+ CFISection& Address(uint64_t address) {
Section::Append(endianness(), address_size_, address);
return *this;
}
- CFISection &Address(Label address) {
+ CFISection& Address(Label address) {
Section::Append(endianness(), address_size_, address);
return *this;
}
@@ -191,26 +191,26 @@ class CFISection: public Section {
//
// (C++ doesn't let me use default arguments here, because I want to
// refer to members of *this in the default argument expression.)
- CFISection &EncodedPointer(uint64_t address) {
+ CFISection& EncodedPointer(uint64_t address) {
return EncodedPointer(address, pointer_encoding_, encoded_pointer_bases_);
}
- CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding) {
+ CFISection& EncodedPointer(uint64_t address, DwarfPointerEncoding encoding) {
return EncodedPointer(address, encoding, encoded_pointer_bases_);
}
- CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding,
- const EncodedPointerBases &bases);
+ CFISection& EncodedPointer(uint64_t address, DwarfPointerEncoding encoding,
+ const EncodedPointerBases& bases);
// Restate some member functions, to keep chaining working nicely.
- CFISection &Mark(Label *label) { Section::Mark(label); return *this; }
- CFISection &D8(uint8_t v) { Section::D8(v); return *this; }
- CFISection &D16(uint16_t v) { Section::D16(v); return *this; }
- CFISection &D16(Label v) { Section::D16(v); return *this; }
- CFISection &D32(uint32_t v) { Section::D32(v); return *this; }
- CFISection &D32(const Label &v) { Section::D32(v); return *this; }
- CFISection &D64(uint64_t v) { Section::D64(v); return *this; }
- CFISection &D64(const Label &v) { Section::D64(v); return *this; }
- CFISection &LEB128(long long v) { Section::LEB128(v); return *this; }
- CFISection &ULEB128(uint64_t v) { Section::ULEB128(v); return *this; }
+ CFISection& Mark(Label* label) { Section::Mark(label); return *this; }
+ CFISection& D8(uint8_t v) { Section::D8(v); return *this; }
+ CFISection& D16(uint16_t v) { Section::D16(v); return *this; }
+ CFISection& D16(Label v) { Section::D16(v); return *this; }
+ CFISection& D32(uint32_t v) { Section::D32(v); return *this; }
+ CFISection& D32(const Label& v) { Section::D32(v); return *this; }
+ CFISection& D64(uint64_t v) { Section::D64(v); return *this; }
+ CFISection& D64(const Label& v) { Section::D64(v); return *this; }
+ CFISection& LEB128(long long v) { Section::LEB128(v); return *this; }
+ CFISection& ULEB128(uint64_t v) { Section::ULEB128(v); return *this; }
private:
// A length value that we've appended to the section, but is not yet
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.cc
index 6384501885e..f5a0683ed39 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.cc
@@ -43,7 +43,7 @@ namespace dwarf2reader {
DIEDispatcher::~DIEDispatcher() {
while (!die_handlers_.empty()) {
- HandlerStack &entry = die_handlers_.top();
+ HandlerStack& entry = die_handlers_.top();
if (entry.handler_ != root_handler_)
delete entry.handler_;
die_handlers_.pop();
@@ -60,7 +60,7 @@ bool DIEDispatcher::StartCompilationUnit(uint64_t offset, uint8_t address_size,
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();
+ HandlerStack* parent = die_handlers_.empty() ? NULL : &die_handlers_.top();
// Does this call indicate that we're done receiving the parent's
// attributes' values? If so, call its EndAttributes member function.
@@ -78,7 +78,7 @@ bool DIEDispatcher::StartDIE(uint64_t offset, enum DwarfTag tag) {
}
// Find a handler for this DIE.
- DIEHandler *handler;
+ DIEHandler* handler;
if (parent) {
if (parent->handler_)
// Ask the parent to find a handler.
@@ -115,7 +115,7 @@ bool DIEDispatcher::StartDIE(uint64_t offset, enum DwarfTag tag) {
void DIEDispatcher::EndDIE(uint64_t offset) {
assert(!die_handlers_.empty());
- HandlerStack *entry = &die_handlers_.top();
+ HandlerStack* entry = &die_handlers_.top();
if (entry->handler_) {
// This entry had better be the handler for this DIE.
assert(entry->offset_ == offset);
@@ -139,7 +139,7 @@ void DIEDispatcher::ProcessAttributeUnsigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
uint64_t data) {
- HandlerStack &current = die_handlers_.top();
+ 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);
@@ -149,7 +149,7 @@ void DIEDispatcher::ProcessAttributeSigned(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
int64_t data) {
- HandlerStack &current = die_handlers_.top();
+ 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);
@@ -159,7 +159,7 @@ void DIEDispatcher::ProcessAttributeReference(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
uint64_t data) {
- HandlerStack &current = die_handlers_.top();
+ 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);
@@ -168,9 +168,9 @@ void DIEDispatcher::ProcessAttributeReference(uint64_t offset,
void DIEDispatcher::ProcessAttributeBuffer(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const uint8_t *data,
+ const uint8_t* data,
uint64_t len) {
- HandlerStack &current = die_handlers_.top();
+ 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);
@@ -180,7 +180,7 @@ void DIEDispatcher::ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string& data) {
- HandlerStack &current = die_handlers_.top();
+ 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_->ProcessAttributeString(attr, form, data);
@@ -190,7 +190,7 @@ void DIEDispatcher::ProcessAttributeSignature(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
uint64_t signature) {
- HandlerStack &current = die_handlers_.top();
+ 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_->ProcessAttributeSignature(attr, form, signature);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.h
index 871ba436d8c..028a6d1196d 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler.h
@@ -208,7 +208,7 @@ class DIEHandler {
uint64_t data) { }
virtual void ProcessAttributeBuffer(enum DwarfAttribute attr,
enum DwarfForm form,
- const uint8_t *data,
+ const uint8_t* data,
uint64_t len) { }
virtual void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
@@ -244,7 +244,7 @@ class DIEHandler {
// it is.
//
// The default definition skips all children.
- virtual DIEHandler *FindChildHandler(uint64_t offset, enum DwarfTag tag) {
+ virtual DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag) {
return NULL;
}
@@ -288,7 +288,7 @@ class DIEDispatcher: public Dwarf2Handler {
// Create a Dwarf2Handler which uses ROOT_HANDLER as the handler for
// the compilation unit's root die, as described for the DIEHandler
// class.
- DIEDispatcher(RootDIEHandler *root_handler) : root_handler_(root_handler) { }
+ DIEDispatcher(RootDIEHandler* root_handler) : root_handler_(root_handler) { }
// Destroying a DIEDispatcher destroys all active handler objects
// except the root handler.
~DIEDispatcher();
@@ -311,12 +311,12 @@ class DIEDispatcher: public Dwarf2Handler {
void ProcessAttributeBuffer(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const uint8_t *data,
+ const uint8_t* data,
uint64_t len);
void ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data);
+ const string& data);
void ProcessAttributeSignature(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
@@ -335,7 +335,7 @@ class DIEDispatcher: public Dwarf2Handler {
// The handler object interested in this DIE's attributes and
// children. If NULL, we're not interested in either.
- DIEHandler *handler_;
+ DIEHandler* handler_;
// Have we reported the end of this DIE's attributes to the handler?
bool reported_attributes_end_;
@@ -358,7 +358,7 @@ class DIEDispatcher: public Dwarf2Handler {
// The root handler. We don't push it on die_handlers_ until we
// actually get the StartDIE call for the root.
- RootDIEHandler *root_handler_;
+ RootDIEHandler* root_handler_;
};
} // namespace dwarf2reader
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
index 01b70489d89..552c3d11dfc 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
@@ -69,9 +69,9 @@ class MockDIEHandler: public DIEHandler {
MOCK_METHOD3(ProcessAttributeReference,
void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const uint8_t *, uint64_t));
+ void(DwarfAttribute, DwarfForm, const uint8_t*, uint64_t));
MOCK_METHOD3(ProcessAttributeString,
- void(DwarfAttribute, DwarfForm, const string &));
+ void(DwarfAttribute, DwarfForm, const string&));
MOCK_METHOD3(ProcessAttributeSignature,
void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD0(EndAttributes, bool());
@@ -88,9 +88,9 @@ class MockRootDIEHandler: public RootDIEHandler {
MOCK_METHOD3(ProcessAttributeReference,
void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const uint8_t *, uint64_t));
+ void(DwarfAttribute, DwarfForm, const uint8_t*, uint64_t));
MOCK_METHOD3(ProcessAttributeString,
- void(DwarfAttribute, DwarfForm, const string &));
+ void(DwarfAttribute, DwarfForm, const string&));
MOCK_METHOD3(ProcessAttributeSignature,
void(DwarfAttribute, DwarfForm, uint64_t));
MOCK_METHOD0(EndAttributes, bool());
@@ -339,7 +339,7 @@ TEST(Dwarf2DIEHandler, FindAndSkipChildren) {
EXPECT_CALL(mock_root_handler,
FindChildHandler(0x97412be24875de9dLL,
(DwarfTag) 0x505a068b))
- .WillOnce(Return((DIEHandler *) NULL));
+ .WillOnce(Return((DIEHandler*) NULL));
// Third child DIE.
EXPECT_CALL(mock_root_handler,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2enums.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2enums.h
index 4316a89ccd6..7bd3979235d 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2enums.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2enums.h
@@ -115,6 +115,16 @@ enum DwarfTag {
DW_TAG_PGI_interface_block = 0xA020
};
+enum DwarfUnitHeader {
+ DW_UT_compile = 0x01,
+ DW_UT_type = 0x02,
+ DW_UT_partial = 0x03,
+ DW_UT_skeleton = 0x04,
+ DW_UT_split_compile = 0x05,
+ DW_UT_split_type = 0x06,
+ DW_UT_lo_user = 0x80,
+ DW_UT_hi_user = 0xFF
+};
enum DwarfHasChild {
DW_children_no = 0,
@@ -149,7 +159,27 @@ enum DwarfForm {
DW_FORM_sec_offset = 0x17,
DW_FORM_exprloc = 0x18,
DW_FORM_flag_present = 0x19,
+
+ // Added in DWARF 5:
+ DW_FORM_strx = 0x1a,
+ DW_FORM_strp_sup = 0x1d,
+ DW_FORM_line_strp = 0x1f,
+
+ // DWARF 4, but value out of order.
DW_FORM_ref_sig8 = 0x20,
+
+ // Added in DWARF 5:
+ DW_FORM_strx1 = 0x25,
+ DW_FORM_strx2 = 0x26,
+ DW_FORM_strx3 = 0x27,
+ DW_FORM_strx4 = 0x28,
+
+ DW_FORM_addrx = 0x1b,
+ DW_FORM_addrx1 = 0x29,
+ DW_FORM_addrx2 = 0x2a,
+ DW_FORM_addrx3 = 0x2b,
+ DW_FORM_addrx4 = 0x2c,
+
// Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
DW_FORM_GNU_addr_index = 0x1f01,
DW_FORM_GNU_str_index = 0x1f02
@@ -286,6 +316,14 @@ enum DwarfAttribute {
DW_AT_PGI_lstride = 0x3a02
};
+// Line number content type codes (DWARF 5).
+enum DwarfLineNumberContentType {
+ DW_LNCT_path = 1,
+ DW_LNCT_directory_index = 2,
+ DW_LNCT_timestamp = 3,
+ DW_LNCT_size = 4,
+ DW_LNCT_MD5 = 5,
+};
// Line number opcodes.
enum DwarfLineNumberOps {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.cc
index 6b9ce2b4f8d..aca836774a0 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.cc
@@ -33,7 +33,6 @@
#include "common/dwarf/dwarf2reader.h"
-#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -54,12 +53,25 @@
namespace dwarf2reader {
+const SectionMap::const_iterator GetSectionByName(const SectionMap&
+ sections, const char *name) {
+ assert(name[0] == '.');
+ auto iter = sections.find(name);
+ if (iter != sections.end())
+ return iter;
+ std::string macho_name("__");
+ macho_name += name + 1;
+ iter = sections.find(macho_name);
+ return iter;
+}
+
CompilationUnit::CompilationUnit(const string& path,
const SectionMap& sections, uint64_t offset,
ByteReader* reader, Dwarf2Handler* handler)
: path_(path), offset_from_section_start_(offset), reader_(reader),
sections_(sections), handler_(handler), abbrevs_(),
string_buffer_(NULL), string_buffer_length_(0),
+ line_string_buffer_(NULL), line_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_(),
@@ -99,12 +111,9 @@ void CompilationUnit::ReadAbbrevs() {
if (abbrevs_)
return;
- // First get the debug_abbrev section. ".debug_abbrev" is the name
- // recommended in the DWARF spec, and used on Linux;
- // "__debug_abbrev" is the name used in Mac OS X Mach-O files.
- SectionMap::const_iterator iter = sections_.find(".debug_abbrev");
- if (iter == sections_.end())
- iter = sections_.find("__debug_abbrev");
+ // First get the debug_abbrev section.
+ SectionMap::const_iterator iter =
+ GetSectionByName(sections_, ".debug_abbrev");
assert(iter != sections_.end());
abbrevs_ = new std::vector<Abbrev>;
@@ -113,9 +122,9 @@ 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 uint8_t *abbrev_start = iter->second.first +
+ const uint8_t* abbrev_start = iter->second.first +
header_.abbrev_offset;
- const uint8_t *abbrevptr = abbrev_start;
+ const uint8_t* abbrevptr = abbrev_start;
#ifndef NDEBUG
const uint64_t abbrev_length = iter->second.second - header_.abbrev_offset;
#endif
@@ -162,7 +171,7 @@ void CompilationUnit::ReadAbbrevs() {
}
// Skips a single DIE's attributes.
-const uint8_t *CompilationUnit::SkipDIE(const uint8_t* start,
+const uint8_t* CompilationUnit::SkipDIE(const uint8_t* start,
const Abbrev& abbrev) {
for (AttributeList::const_iterator i = abbrev.attributes.begin();
i != abbrev.attributes.end();
@@ -173,7 +182,7 @@ const uint8_t *CompilationUnit::SkipDIE(const uint8_t* start,
}
// Skips a single attribute form's data.
-const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
+const uint8_t* CompilationUnit::SkipAttribute(const uint8_t* start,
enum DwarfForm form) {
size_t len;
@@ -186,26 +195,37 @@ const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
case DW_FORM_flag_present:
return start;
+ case DW_FORM_addrx1:
case DW_FORM_data1:
case DW_FORM_flag:
case DW_FORM_ref1:
+ case DW_FORM_strx1:
return start + 1;
+ case DW_FORM_addrx2:
case DW_FORM_ref2:
case DW_FORM_data2:
+ case DW_FORM_strx2:
return start + 2;
+ case DW_FORM_addrx3:
+ case DW_FORM_strx3:
+ return start + 3;
+ case DW_FORM_addrx4:
case DW_FORM_ref4:
case DW_FORM_data4:
+ case DW_FORM_strx4:
return start + 4;
case DW_FORM_ref8:
case DW_FORM_data8:
case DW_FORM_ref_sig8:
return start + 8;
case DW_FORM_string:
- return start + strlen(reinterpret_cast<const char *>(start)) + 1;
+ return start + strlen(reinterpret_cast<const char*>(start)) + 1;
case DW_FORM_udata:
case DW_FORM_ref_udata:
+ case DW_FORM_strx:
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_addr_index:
+ case DW_FORM_addrx:
reader_->ReadUnsignedLEB128(start, &len);
return start + len;
@@ -237,6 +257,8 @@ const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
return start + size + len;
}
case DW_FORM_strp:
+ case DW_FORM_line_strp:
+ case DW_FORM_strp_sup:
case DW_FORM_sec_offset:
return start + reader_->OffsetSize();
}
@@ -244,13 +266,52 @@ const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
return NULL;
}
-// Read a DWARF2/3 header.
-// The header is variable length in DWARF3 (and DWARF2 as extended by
-// most compilers), and consists of an length field, a version number,
-// the offset in the .debug_abbrev section for our abbrevs, and an
-// address size.
+// Read the abbreviation offset from a compilation unit header.
+size_t CompilationUnit::ReadAbbrevOffset(const uint8_t* headerptr) {
+ assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_);
+ header_.abbrev_offset = reader_->ReadOffset(headerptr);
+ return reader_->OffsetSize();
+}
+
+// Read the address size from a compilation unit header.
+size_t CompilationUnit::ReadAddressSize(const uint8_t* headerptr) {
+ // 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);
+ return 1;
+}
+
+// Read the DWO id from a split or skeleton compilation unit header.
+size_t CompilationUnit::ReadDwoId(const uint8_t* headerptr) {
+ assert(headerptr + 8 <= buffer_ + buffer_length_);
+ dwo_id_ = reader_->ReadEightBytes(headerptr);
+ return 8;
+}
+
+// Read the type signature from a type or split type compilation unit header.
+size_t CompilationUnit::ReadTypeSignature(const uint8_t* headerptr) {
+ assert(headerptr + 8 <= buffer_ + buffer_length_);
+ type_signature_ = reader_->ReadEightBytes(headerptr);
+ return 8;
+}
+
+// Read the DWO id from a split or skeleton compilation unit header.
+size_t CompilationUnit::ReadTypeOffset(const uint8_t* headerptr) {
+ assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_);
+ type_offset_ = reader_->ReadOffset(headerptr);
+ return reader_->OffsetSize();
+}
+
+
+// Read a DWARF header. The header is variable length in DWARF3 and DWARF4
+// (and DWARF2 as extended by most compilers), and consists of an length
+// field, a version number, the offset in the .debug_abbrev section for our
+// abbrevs, and an address size. DWARF5 adds a unit_type to distinguish
+// between partial-, full-, skeleton-, split-, and type- compilation units.
void CompilationUnit::ReadHeader() {
- const uint8_t *headerptr = buffer_;
+ const uint8_t* headerptr = buffer_;
size_t initial_length_size;
assert(headerptr + 4 < buffer_ + buffer_length_);
@@ -263,17 +324,36 @@ void CompilationUnit::ReadHeader() {
header_.version = reader_->ReadTwoBytes(headerptr);
headerptr += 2;
- assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_);
- header_.abbrev_offset = reader_->ReadOffset(headerptr);
- headerptr += reader_->OffsetSize();
-
- // 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;
-
+ if (header_.version <= 4) {
+ // Older versions of dwarf have a relatively simple structure.
+ headerptr += ReadAbbrevOffset(headerptr);
+ headerptr += ReadAddressSize(headerptr);
+ } else {
+ // DWARF5 adds a unit_type field, and various fields based on unit_type.
+ assert(headerptr + 1 < buffer_ + buffer_length_);
+ uint8_t unit_type = reader_->ReadOneByte(headerptr);
+ headerptr += 1;
+ headerptr += ReadAddressSize(headerptr);
+ headerptr += ReadAbbrevOffset(headerptr);
+ switch (unit_type) {
+ case DW_UT_compile:
+ case DW_UT_partial:
+ // nothing else to read
+ break;
+ case DW_UT_skeleton:
+ case DW_UT_split_compile:
+ headerptr += ReadDwoId(headerptr);
+ break;
+ case DW_UT_type:
+ case DW_UT_split_type:
+ headerptr += ReadTypeSignature(headerptr);
+ headerptr += ReadTypeOffset(headerptr);
+ break;
+ default:
+ fprintf(stderr, "Unhandled compilation unit type 0x%x", unit_type);
+ break;
+ }
+ }
after_header_ = headerptr;
// This check ensures that we don't have to do checking during the
@@ -284,12 +364,9 @@ void CompilationUnit::ReadHeader() {
}
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.
- SectionMap::const_iterator iter = sections_.find(".debug_info");
- if (iter == sections_.end())
- iter = sections_.find("__debug_info");
+ // First get the debug_info section.
+ SectionMap::const_iterator iter =
+ GetSectionByName(sections_, ".debug_info");
assert(iter != sections_.end());
// Set up our buffer
@@ -319,26 +396,29 @@ uint64_t CompilationUnit::Start() {
// Otherwise, continue by reading our abbreviation entries.
ReadAbbrevs();
- // Set the string section if we have one. ".debug_str" is the name
- // recommended in the DWARF spec, and used on Linux; "__debug_str"
- // is the name used in Mac OS X Mach-O files.
- iter = sections_.find(".debug_str");
- if (iter == sections_.end())
- iter = sections_.find("__debug_str");
+ // Set the string section if we have one.
+ iter = GetSectionByName(sections_, ".debug_str");
if (iter != sections_.end()) {
string_buffer_ = iter->second.first;
string_buffer_length_ = iter->second.second;
}
+ // Set the line string section if we have one.
+ iter = GetSectionByName(sections_, ".debug_line_str");
+ if (iter != sections_.end()) {
+ line_string_buffer_ = iter->second.first;
+ line_string_buffer_length_ = iter->second.second;
+ }
+
// Set the string offsets section if we have one.
- iter = sections_.find(".debug_str_offsets");
+ iter = GetSectionByName(sections_, ".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");
+ iter = GetSectionByName(sections_, ".debug_addr");
if (iter != sections_.end()) {
addr_buffer_ = iter->second.first;
addr_buffer_length_ = iter->second.second;
@@ -358,11 +438,25 @@ uint64_t CompilationUnit::Start() {
return ourlength;
}
+void CompilationUnit::ProcessFormStringIndex(
+ uint64_t dieoffset, enum DwarfAttribute attr, enum DwarfForm form,
+ uint64_t str_index) {
+ 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;
+ }
+
+ const char* str = reinterpret_cast<const char*>(string_buffer_) + offset;
+ ProcessAttributeString(dieoffset, attr, form, str);
+}
+
// If one really wanted, you could merge SkipAttribute and
// ProcessAttribute
// This is all boring data manipulation and calling of the handler.
-const uint8_t *CompilationUnit::ProcessAttribute(
- uint64_t dieoffset, const uint8_t *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;
@@ -396,7 +490,7 @@ const uint8_t *CompilationUnit::ProcessAttribute(
reader_->ReadEightBytes(start));
return start + 8;
case DW_FORM_string: {
- const char *str = reinterpret_cast<const char *>(start);
+ const char* str = reinterpret_cast<const char*>(start);
ProcessAttributeString(dieoffset, attr, form, str);
return start + strlen(str) + 1;
}
@@ -494,40 +588,82 @@ const uint8_t *CompilationUnit::ProcessAttribute(
const uint64_t offset = reader_->ReadOffset(start);
assert(string_buffer_ + offset < string_buffer_ + string_buffer_length_);
- const char *str = reinterpret_cast<const char *>(string_buffer_ + offset);
+ const char* str = reinterpret_cast<const char*>(string_buffer_ + offset);
ProcessAttributeString(dieoffset, attr, form, str);
return start + reader_->OffsetSize();
}
+ case DW_FORM_line_strp: {
+ assert(line_string_buffer_ != NULL);
- 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 uint64_t offset = reader_->ReadOffset(start);
+ assert(line_string_buffer_ + offset <
+ line_string_buffer_ + line_string_buffer_length_);
- const char* str = reinterpret_cast<const char *>(string_buffer_) + offset;
+ const char* str =
+ reinterpret_cast<const char*>(line_string_buffer_ + offset);
ProcessAttributeString(dieoffset, attr, form, str);
- return start + len;
- break;
+ return start + reader_->OffsetSize();
}
- 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));
+ case DW_FORM_strp_sup:
+ // No support currently for suplementary object files.
+ fprintf(stderr, "Unhandled form type: DW_FORM_strp_sup\n");
+ return start + 4;
+
+ case DW_FORM_strx:
+ case DW_FORM_GNU_str_index: {
+ uint64_t str_index = reader_->ReadUnsignedLEB128(start, &len);
+ ProcessFormStringIndex(dieoffset, attr, form, str_index);
return start + len;
}
+ case DW_FORM_strx1: {
+ uint64_t str_index = reader_->ReadOneByte(start);
+ ProcessFormStringIndex(dieoffset, attr, form, str_index);
+ return start + 1;
+ }
+ case DW_FORM_strx2: {
+ uint64_t str_index = reader_->ReadTwoBytes(start);
+ ProcessFormStringIndex(dieoffset, attr, form, str_index);
+ return start + 2;
+ }
+ case DW_FORM_strx3: {
+ uint64_t str_index = reader_->ReadThreeBytes(start);
+ ProcessFormStringIndex(dieoffset, attr, form, str_index);
+ return start + 3;
+ }
+ case DW_FORM_strx4: {
+ uint64_t str_index = reader_->ReadFourBytes(start);
+ ProcessFormStringIndex(dieoffset, attr, form, str_index);
+ return start + 4;
+ }
+
+ case DW_FORM_addrx:
+ case DW_FORM_GNU_addr_index:
+ ProcessAttributeAddrIndex(
+ dieoffset, attr, form, reader_->ReadUnsignedLEB128(start, &len));
+ return start + len;
+ case DW_FORM_addrx1:
+ ProcessAttributeAddrIndex(
+ dieoffset, attr, form, reader_->ReadOneByte(start));
+ return start + 1;
+ case DW_FORM_addrx2:
+ ProcessAttributeAddrIndex(
+ dieoffset, attr, form, reader_->ReadTwoBytes(start));
+ return start + 2;
+ case DW_FORM_addrx3:
+ ProcessAttributeAddrIndex(
+ dieoffset, attr, form, reader_->ReadThreeBytes(start));
+ return start + 3;
+ case DW_FORM_addrx4:
+ ProcessAttributeAddrIndex(
+ dieoffset, attr, form, reader_->ReadFourBytes(start));
+ return start + 4;
}
fprintf(stderr, "Unhandled form type\n");
return NULL;
}
-const uint8_t *CompilationUnit::ProcessDIE(uint64_t dieoffset,
- const uint8_t *start,
+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();
@@ -548,12 +684,12 @@ const uint8_t *CompilationUnit::ProcessDIE(uint64_t dieoffset,
}
void CompilationUnit::ProcessDIEs() {
- const uint8_t *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 uint8_t *lengthstart = buffer_;
+ const uint8_t* lengthstart = buffer_;
// In 64 bit dwarf, the initial length is 12 bytes, because of the
// 0xffffffff at the start.
@@ -691,7 +827,7 @@ void CompilationUnit::ReadDebugSectionsFromDwo(ElfReader* elf_reader,
if (section_data != NULL)
sections->insert(std::make_pair(
base_name, std::make_pair(
- reinterpret_cast<const uint8_t *>(section_data),
+ reinterpret_cast<const uint8_t*>(section_data),
section_size)));
}
}
@@ -720,11 +856,11 @@ void DwpReader::Initialize() {
&string_buffer_size_);
version_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_));
+ reinterpret_cast<const uint8_t*>(cu_index_));
if (version_ == 1) {
nslots_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_)
+ reinterpret_cast<const uint8_t*>(cu_index_)
+ 3 * sizeof(uint32_t));
phash_ = cu_index_ + 4 * sizeof(uint32_t);
pindex_ = phash_ + nslots_ * sizeof(uint64_t);
@@ -734,11 +870,11 @@ void DwpReader::Initialize() {
}
} else if (version_ == 2) {
ncolumns_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_) + sizeof(uint32_t));
+ 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));
+ 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));
+ 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);
@@ -766,7 +902,7 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
// 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_)
+ reinterpret_cast<const uint8_t*>(pindex_)
+ slot * sizeof(uint32_t));
const char* shndx_list = shndx_pool_ + index * sizeof(uint32_t);
for (;;) {
@@ -775,7 +911,7 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
return;
}
unsigned int shndx = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(shndx_list));
+ reinterpret_cast<const uint8_t*>(shndx_list));
shndx_list += sizeof(uint32_t);
if (shndx == 0)
break;
@@ -789,26 +925,26 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
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),
+ 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),
+ 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),
+ 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_),
+ std::make_pair(reinterpret_cast<const uint8_t*> (string_buffer_),
string_buffer_size_)));
} else if (version_ == 2) {
uint32_t index = LookupCUv2(dwo_id);
@@ -833,33 +969,33 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
}
for (unsigned int col = 0u; col < ncolumns_; ++col) {
uint32_t section_id =
- byte_reader_.ReadFourBytes(reinterpret_cast<const uint8_t *>(id_row)
+ 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)
+ 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));
+ 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_)
+ 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_)
+ 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_)
+ 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_),
+ std::make_pair(reinterpret_cast<const uint8_t*> (string_buffer_),
string_buffer_size_)));
}
}
@@ -867,14 +1003,14 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
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));
+ 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));
+ reinterpret_cast<const uint8_t*>(phash_) + slot * sizeof(uint64_t));
} while (probe != 0 && probe != dwo_id);
}
if (probe == 0)
@@ -885,28 +1021,35 @@ int DwpReader::LookupCU(uint64_t dwo_id) {
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));
+ 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));
+ 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));
+ reinterpret_cast<const uint8_t*>(phash_) + slot * sizeof(uint64_t));
index = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(pindex_) + slot * sizeof(uint32_t));
+ 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) {
+LineInfo::LineInfo(const uint8_t* buffer, uint64_t buffer_length,
+ ByteReader* reader, const uint8_t* string_buffer,
+ size_t string_buffer_length,
+ const uint8_t* line_string_buffer,
+ size_t line_string_buffer_length, LineInfoHandler* handler):
+ handler_(handler), reader_(reader), buffer_(buffer),
+ string_buffer_(string_buffer),
+ line_string_buffer_(line_string_buffer) {
#ifndef NDEBUG
buffer_length_ = buffer_length;
+ string_buffer_length_ = string_buffer_length;
+ line_string_buffer_length_ = line_string_buffer_length;
#endif
header_.std_opcode_lengths = NULL;
}
@@ -917,10 +1060,132 @@ uint64_t LineInfo::Start() {
return after_header_ - buffer_;
}
+void LineInfo::ReadTypesAndForms(const uint8_t** lineptr,
+ uint32_t* content_types,
+ uint32_t* content_forms,
+ uint32_t max_types,
+ uint32_t* format_count) {
+ size_t len;
+
+ uint32_t count = reader_->ReadUnsignedLEB128(*lineptr, &len);
+ *lineptr += len;
+ if (count < 1 || count > max_types) {
+ return;
+ }
+ for (uint32_t col = 0; col < count; ++col) {
+ content_types[col] = reader_->ReadUnsignedLEB128(*lineptr, &len);
+ *lineptr += len;
+ content_forms[col] = reader_->ReadUnsignedLEB128(*lineptr, &len);
+ *lineptr += len;
+ }
+ *format_count = count;
+}
+
+const char* LineInfo::ReadStringForm(uint32_t form, const uint8_t** lineptr) {
+ const char* name = nullptr;
+ if (form == DW_FORM_string) {
+ name = reinterpret_cast<const char*>(*lineptr);
+ *lineptr += strlen(name) + 1;
+ return name;
+ } else if (form == DW_FORM_strp) {
+ uint64_t offset = reader_->ReadOffset(*lineptr);
+ assert(offset < string_buffer_length_);
+ *lineptr += reader_->OffsetSize();
+ if (string_buffer_ != nullptr) {
+ name = reinterpret_cast<const char*>(string_buffer_) + offset;
+ return name;
+ }
+ } else if (form == DW_FORM_line_strp) {
+ uint64_t offset = reader_->ReadOffset(*lineptr);
+ assert(offset < line_string_buffer_length_);
+ *lineptr += reader_->OffsetSize();
+ if (line_string_buffer_ != nullptr) {
+ name = reinterpret_cast<const char*>(line_string_buffer_) + offset;
+ return name;
+ }
+ }
+ // Shouldn't be called with a non-string-form, and
+ // if there is a string form but no string buffer,
+ // that is a problem too.
+ assert(0);
+ return nullptr;
+}
+
+uint64_t LineInfo::ReadUnsignedData(uint32_t form, const uint8_t** lineptr) {
+ size_t len;
+ uint64_t value;
+
+ switch (form) {
+ case DW_FORM_data1:
+ value = reader_->ReadOneByte(*lineptr);
+ *lineptr += 1;
+ return value;
+ case DW_FORM_data2:
+ value = reader_->ReadTwoBytes(*lineptr);
+ *lineptr += 2;
+ return value;
+ case DW_FORM_data4:
+ value = reader_->ReadFourBytes(*lineptr);
+ *lineptr += 4;
+ return value;
+ case DW_FORM_data8:
+ value = reader_->ReadEightBytes(*lineptr);
+ *lineptr += 8;
+ return value;
+ case DW_FORM_udata:
+ value = reader_->ReadUnsignedLEB128(*lineptr, &len);
+ *lineptr += len;
+ return value;
+ default:
+ fprintf(stderr, "Unrecognized data form.");
+ return 0;
+ }
+}
+
+void LineInfo::ReadFileRow(const uint8_t** lineptr,
+ const uint32_t* content_types,
+ const uint32_t* content_forms, uint32_t row,
+ uint32_t format_count) {
+ const char* filename = nullptr;
+ uint64_t dirindex = 0;
+ uint64_t mod_time = 0;
+ uint64_t filelength = 0;
+
+ for (uint32_t col = 0; col < format_count; ++col) {
+ switch (content_types[col]) {
+ case DW_LNCT_path:
+ filename = ReadStringForm(content_forms[col], lineptr);
+ break;
+ case DW_LNCT_directory_index:
+ dirindex = ReadUnsignedData(content_forms[col], lineptr);
+ break;
+ case DW_LNCT_timestamp:
+ mod_time = ReadUnsignedData(content_forms[col], lineptr);
+ break;
+ case DW_LNCT_size:
+ filelength = ReadUnsignedData(content_forms[col], lineptr);
+ break;
+ case DW_LNCT_MD5:
+ // MD5 entries help a debugger sort different versions of files with
+ // the same name. It is always paired with a DW_FORM_data16 and is
+ // unused in this case.
+ lineptr += 16;
+ break;
+ default:
+ fprintf(stderr, "Unrecognized form in line table header. %d\n",
+ content_types[col]);
+ assert(false);
+ break;
+ }
+ }
+ assert(filename != nullptr);
+ handler_->DefineFile(filename, row, dirindex, mod_time, filelength);
+}
+
// The header for a debug_line section is mildly complicated, because
// the line info is very tightly encoded.
void LineInfo::ReadHeader() {
- const uint8_t *lineptr = buffer_;
+ const uint8_t* lineptr = buffer_;
size_t initial_length_size;
const uint64_t initial_length
@@ -931,12 +1196,24 @@ void LineInfo::ReadHeader() {
assert(buffer_ + initial_length_size + header_.total_length <=
buffer_ + buffer_length_);
- // Address size *must* be set by CU ahead of time.
- assert(reader_->AddressSize() != 0);
header_.version = reader_->ReadTwoBytes(lineptr);
lineptr += 2;
+ if (header_.version >= 5) {
+ uint8_t address_size = reader_->ReadOneByte(lineptr);
+ reader_->SetAddressSize(address_size);
+ lineptr += 1;
+ uint8_t segment_selector_size = reader_->ReadOneByte(lineptr);
+ if (segment_selector_size != 0) {
+ fprintf(stderr,"No support for segmented memory.");
+ }
+ lineptr += 1;
+ } else {
+ // Address size *must* be set by CU ahead of time.
+ assert(reader_->AddressSize() != 0);
+ }
+
header_.prologue_length = reader_->ReadOffset(lineptr);
lineptr += reader_->OffsetSize();
@@ -970,53 +1247,96 @@ void LineInfo::ReadHeader() {
lineptr += 1;
}
- // It is legal for the directory entry table to be empty.
- if (*lineptr) {
- uint32_t dirindex = 1;
- while (*lineptr) {
- const char *dirname = reinterpret_cast<const char *>(lineptr);
- handler_->DefineDir(dirname, dirindex);
- lineptr += strlen(dirname) + 1;
- dirindex++;
+ if (header_.version <= 4) {
+ // Directory zero is assumed to be the compilation directory and special
+ // cased where used. It is not actually stored in the dwarf data. But an
+ // empty entry here avoids off-by-one errors elsewhere in the code.
+ handler_->DefineDir("", 0);
+ // It is legal for the directory entry table to be empty.
+ if (*lineptr) {
+ uint32_t dirindex = 1;
+ while (*lineptr) {
+ const char* dirname = reinterpret_cast<const char*>(lineptr);
+ handler_->DefineDir(dirname, dirindex);
+ lineptr += strlen(dirname) + 1;
+ dirindex++;
+ }
}
- }
- lineptr++;
-
- // It is also legal for the file entry table to be empty.
- if (*lineptr) {
- uint32_t fileindex = 1;
+ lineptr++;
+ // It is also legal for the file entry table to be empty.
+
+ // Similarly for file zero.
+ handler_->DefineFile("", 0, 0, 0, 0);
+ if (*lineptr) {
+ uint32_t fileindex = 1;
+ size_t len;
+ while (*lineptr) {
+ const char* filename = ReadStringForm(DW_FORM_string, &lineptr);
+
+ uint64_t dirindex = reader_->ReadUnsignedLEB128(lineptr, &len);
+ lineptr += len;
+
+ uint64_t mod_time = reader_->ReadUnsignedLEB128(lineptr, &len);
+ lineptr += len;
+
+ uint64_t filelength = reader_->ReadUnsignedLEB128(lineptr, &len);
+ lineptr += len;
+ handler_->DefineFile(filename, fileindex,
+ static_cast<uint32_t>(dirindex), mod_time,
+ filelength);
+ fileindex++;
+ }
+ }
+ lineptr++;
+ } else {
+ // Read the DWARF-5 directory table.
+
+ // Dwarf5 supports five different types and forms per directory- and
+ // file-table entry. Theoretically, there could be duplicate entries
+ // in this table, but that would be quite unusual.
+ static const uint32_t kMaxTypesAndForms = 5;
+ uint32_t content_types[kMaxTypesAndForms];
+ uint32_t content_forms[kMaxTypesAndForms];
+ uint32_t format_count;
size_t len;
- while (*lineptr) {
- const char *filename = reinterpret_cast<const char *>(lineptr);
- lineptr += strlen(filename) + 1;
- uint64_t dirindex = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
+ ReadTypesAndForms(&lineptr, content_types, content_forms, kMaxTypesAndForms,
+ &format_count);
+ uint32_t entry_count = reader_->ReadUnsignedLEB128(lineptr, &len);
+ lineptr += len;
+ for (uint32_t row = 0; row < entry_count; ++row) {
+ const char* dirname = nullptr;
+ for (uint32_t col = 0; col < format_count; ++col) {
+ // The path is the only relevant content type for this implementation.
+ if (content_types[col] == DW_LNCT_path) {
+ dirname = ReadStringForm(content_forms[col], &lineptr);
+ }
+ }
+ handler_->DefineDir(dirname, row);
+ }
- uint64_t mod_time = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
+ // Read the DWARF-5 filename table.
+ ReadTypesAndForms(&lineptr, content_types, content_forms, kMaxTypesAndForms,
+ &format_count);
+ entry_count = reader_->ReadUnsignedLEB128(lineptr, &len);
+ lineptr += len;
- uint64_t filelength = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
- handler_->DefineFile(filename, fileindex, static_cast<uint32_t>(dirindex),
- mod_time, filelength);
- fileindex++;
+ for (uint32_t row = 0; row < entry_count; ++row) {
+ ReadFileRow(&lineptr, content_types, content_forms, row, format_count);
}
}
- lineptr++;
-
after_header_ = lineptr;
}
/* static */
bool LineInfo::ProcessOneOpcode(ByteReader* reader,
LineInfoHandler* handler,
- const struct LineInfoHeader &header,
- const uint8_t *start,
+ const struct LineInfoHeader& header,
+ const uint8_t* start,
struct LineStateMachine* lsm,
size_t* len,
uintptr pc,
- bool *lsm_passes_pc) {
+ bool* lsm_passes_pc) {
size_t oplen = 0;
size_t templen;
uint8_t opcode = reader->ReadOneByte(start);
@@ -1153,7 +1473,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
}
break;
case DW_LNE_define_file: {
- const char *filename = reinterpret_cast<const char *>(start);
+ const char* filename = reinterpret_cast<const char*>(start);
templen = strlen(filename) + 1;
start += templen;
@@ -1200,7 +1520,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 uint8_t *lengthstart = buffer_;
+ const uint8_t* lengthstart = buffer_;
// In 64 bit dwarf, the initial length is 12 bytes, because of the
// 0xffffffff at the start.
@@ -1209,7 +1529,7 @@ void LineInfo::ReadLines() {
else
lengthstart += 4;
- const uint8_t *lineptr = after_header_;
+ const uint8_t* lineptr = after_header_;
lsm.Reset(header_.default_is_stmt);
// The LineInfoHandler interface expects each line's length along
@@ -1248,8 +1568,8 @@ void LineInfo::ReadLines() {
after_header_ = lengthstart + header_.total_length;
}
-RangeListReader::RangeListReader(const uint8_t *buffer, uint64_t size,
- ByteReader *reader, RangeListHandler *handler)
+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) {
@@ -1305,17 +1625,17 @@ class CallFrameInfo::Rule {
// this rule. If REG is kCFARegister, then this rule describes how to compute
// the canonical frame address. Return what the HANDLER member function
// returned.
- virtual bool Handle(Handler *handler,
+ virtual bool Handle(Handler* handler,
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.
- virtual bool operator==(const Rule &rhs) const = 0;
+ virtual bool operator==(const Rule& rhs) const = 0;
- bool operator!=(const Rule &rhs) const { return ! (*this == rhs); }
+ bool operator!=(const Rule& rhs) const { return ! (*this == rhs); }
// Return a pointer to a copy of this rule.
- virtual Rule *Copy() const = 0;
+ virtual Rule* Copy() const = 0;
// If this is a base+offset rule, change its base register to REG.
// Otherwise, do nothing. (Ugly, but required for DW_CFA_def_cfa_register.)
@@ -1331,16 +1651,16 @@ class CallFrameInfo::UndefinedRule: public CallFrameInfo::Rule {
public:
UndefinedRule() { }
~UndefinedRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const UndefinedRule *our_rhs = dynamic_cast<const UndefinedRule *>(&rhs);
+ const UndefinedRule* our_rhs = dynamic_cast<const UndefinedRule*>(&rhs);
return (our_rhs != NULL);
}
- Rule *Copy() const { return new UndefinedRule(*this); }
+ Rule* Copy() const { return new UndefinedRule(*this); }
};
// Rule: the register's value is the same as that it had in the caller.
@@ -1348,16 +1668,16 @@ class CallFrameInfo::SameValueRule: public CallFrameInfo::Rule {
public:
SameValueRule() { }
~SameValueRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const SameValueRule *our_rhs = dynamic_cast<const SameValueRule *>(&rhs);
+ const SameValueRule* our_rhs = dynamic_cast<const SameValueRule*>(&rhs);
return (our_rhs != NULL);
}
- Rule *Copy() const { return new SameValueRule(*this); }
+ Rule* Copy() const { return new SameValueRule(*this); }
};
// Rule: the register is saved at OFFSET from BASE_REGISTER. BASE_REGISTER
@@ -1367,18 +1687,18 @@ class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
OffsetRule(int base_register, long offset)
: base_register_(base_register), offset_(offset) { }
~OffsetRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const OffsetRule *our_rhs = dynamic_cast<const OffsetRule *>(&rhs);
+ const OffsetRule* our_rhs = dynamic_cast<const OffsetRule*>(&rhs);
return (our_rhs &&
base_register_ == our_rhs->base_register_ &&
offset_ == our_rhs->offset_);
}
- Rule *Copy() const { return new OffsetRule(*this); }
+ Rule* Copy() const { return new OffsetRule(*this); }
// We don't actually need SetBaseRegister or SetOffset here, since they
// are only ever applied to CFA rules, for DW_CFA_def_cfa_offset, and it
// doesn't make sense to use OffsetRule for computing the CFA: it
@@ -1396,18 +1716,18 @@ class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
ValOffsetRule(int base_register, long offset)
: base_register_(base_register), offset_(offset) { }
~ValOffsetRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ValOffsetRule *our_rhs = dynamic_cast<const ValOffsetRule *>(&rhs);
+ const ValOffsetRule* our_rhs = dynamic_cast<const ValOffsetRule*>(&rhs);
return (our_rhs &&
base_register_ == our_rhs->base_register_ &&
offset_ == our_rhs->offset_);
}
- Rule *Copy() const { return new ValOffsetRule(*this); }
+ Rule* Copy() const { return new ValOffsetRule(*this); }
void SetBaseRegister(unsigned reg) { base_register_ = reg; }
void SetOffset(long long offset) { offset_ = offset; }
private:
@@ -1421,16 +1741,16 @@ class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
explicit RegisterRule(int register_number)
: register_number_(register_number) { }
~RegisterRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const RegisterRule *our_rhs = dynamic_cast<const RegisterRule *>(&rhs);
+ const RegisterRule* our_rhs = dynamic_cast<const RegisterRule*>(&rhs);
return (our_rhs && register_number_ == our_rhs->register_number_);
}
- Rule *Copy() const { return new RegisterRule(*this); }
+ Rule* Copy() const { return new RegisterRule(*this); }
private:
int register_number_;
};
@@ -1438,19 +1758,19 @@ class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
// Rule: EXPRESSION evaluates to the address at which the register is saved.
class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
public:
- explicit ExpressionRule(const string &expression)
+ explicit ExpressionRule(const string& expression)
: expression_(expression) { }
~ExpressionRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ExpressionRule *our_rhs = dynamic_cast<const ExpressionRule *>(&rhs);
+ const ExpressionRule* our_rhs = dynamic_cast<const ExpressionRule*>(&rhs);
return (our_rhs && expression_ == our_rhs->expression_);
}
- Rule *Copy() const { return new ExpressionRule(*this); }
+ Rule* Copy() const { return new ExpressionRule(*this); }
private:
string expression_;
};
@@ -1458,20 +1778,20 @@ class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
// Rule: EXPRESSION evaluates to the address at which the register is saved.
class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
public:
- explicit ValExpressionRule(const string &expression)
+ explicit ValExpressionRule(const string& expression)
: expression_(expression) { }
~ValExpressionRule() { }
- bool Handle(Handler *handler, uint64_t 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 {
+ bool operator==(const Rule& rhs) const {
// dynamic_cast is allowed by the Google C++ Style Guide, if the use has
// been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ValExpressionRule *our_rhs =
- dynamic_cast<const ValExpressionRule *>(&rhs);
+ const ValExpressionRule* our_rhs =
+ dynamic_cast<const ValExpressionRule*>(&rhs);
return (our_rhs && expression_ == our_rhs->expression_);
}
- Rule *Copy() const { return new ValExpressionRule(*this); }
+ Rule* Copy() const { return new ValExpressionRule(*this); }
private:
string expression_;
};
@@ -1480,51 +1800,51 @@ class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
class CallFrameInfo::RuleMap {
public:
RuleMap() : cfa_rule_(NULL) { }
- RuleMap(const RuleMap &rhs) : cfa_rule_(NULL) { *this = rhs; }
+ RuleMap(const RuleMap& rhs) : cfa_rule_(NULL) { *this = rhs; }
~RuleMap() { Clear(); }
- RuleMap &operator=(const RuleMap &rhs);
+ RuleMap& operator=(const RuleMap& rhs);
// Set the rule for computing the CFA to RULE. Take ownership of RULE.
- void SetCFARule(Rule *rule) { delete cfa_rule_; cfa_rule_ = rule; }
+ void SetCFARule(Rule* rule) { delete cfa_rule_; cfa_rule_ = rule; }
// Return the current CFA rule. Unlike RegisterRule, this RuleMap retains
// ownership of the rule. We use this for DW_CFA_def_cfa_offset and
// DW_CFA_def_cfa_register, and for detecting references to the CFA before
// a rule for it has been established.
- Rule *CFARule() const { return cfa_rule_; }
+ Rule* CFARule() const { return cfa_rule_; }
// Return the rule for REG, or NULL if there is none. The caller takes
// ownership of the result.
- Rule *RegisterRule(int reg) const;
+ Rule* RegisterRule(int reg) const;
// Set the rule for computing REG to RULE. Take ownership of RULE.
- void SetRegisterRule(int reg, Rule *rule);
+ void SetRegisterRule(int reg, Rule* rule);
// Make all the appropriate calls to HANDLER as if we were changing from
// 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_t address,
- const RuleMap &new_rules) const;
+ bool HandleTransitionTo(Handler* handler, uint64_t address,
+ const RuleMap& new_rules) const;
private:
// A map from register numbers to Rules.
- typedef std::map<int, Rule *> RuleByNumber;
+ typedef std::map<int, Rule*> RuleByNumber;
// Remove all register rules and clear cfa_rule_.
void Clear();
// The rule for computing the canonical frame address. This RuleMap owns
// this rule.
- Rule *cfa_rule_;
+ Rule* cfa_rule_;
// A map from register numbers to postfix expressions to recover
// their values. This RuleMap owns the Rules the map refers to.
RuleByNumber registers_;
};
-CallFrameInfo::RuleMap &CallFrameInfo::RuleMap::operator=(const RuleMap &rhs) {
+CallFrameInfo::RuleMap& CallFrameInfo::RuleMap::operator=(const RuleMap& rhs) {
Clear();
// Since each map owns the rules it refers to, assignment must copy them.
if (rhs.cfa_rule_) cfa_rule_ = rhs.cfa_rule_->Copy();
@@ -1534,7 +1854,7 @@ CallFrameInfo::RuleMap &CallFrameInfo::RuleMap::operator=(const RuleMap &rhs) {
return *this;
}
-CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const {
+CallFrameInfo::Rule* CallFrameInfo::RuleMap::RegisterRule(int reg) const {
assert(reg != Handler::kCFARegister);
RuleByNumber::const_iterator it = registers_.find(reg);
if (it != registers_.end())
@@ -1543,18 +1863,18 @@ CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const {
return NULL;
}
-void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule *rule) {
+void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule* rule) {
assert(reg != Handler::kCFARegister);
assert(rule);
- Rule **slot = &registers_[reg];
+ Rule** slot = &registers_[reg];
delete *slot;
*slot = rule;
}
bool CallFrameInfo::RuleMap::HandleTransitionTo(
- Handler *handler,
+ Handler* handler,
uint64_t address,
- const RuleMap &new_rules) const {
+ const RuleMap& new_rules) const {
// Transition from cfa_rule_ to new_rules.cfa_rule_.
if (cfa_rule_ && new_rules.cfa_rule_) {
if (*cfa_rule_ != *new_rules.cfa_rule_ &&
@@ -1634,7 +1954,7 @@ class CallFrameInfo::State {
public:
// 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,
+ State(ByteReader* reader, Handler* handler, Reporter* reporter,
uint64_t address)
: reader_(reader), handler_(handler), reporter_(reporter),
address_(address), entry_(NULL), cursor_(NULL) { }
@@ -1642,11 +1962,11 @@ class CallFrameInfo::State {
// Interpret instructions from CIE, save the resulting rule set for
// DW_CFA_restore instructions, and return true. On error, report
// the problem to reporter_ and return false.
- bool InterpretCIE(const CIE &cie);
+ bool InterpretCIE(const CIE& cie);
// Interpret instructions from FDE, and return true. On error,
// report the problem to reporter_ and return false.
- bool InterpretFDE(const FDE &fde);
+ bool InterpretFDE(const FDE& fde);
private:
// The operands of a CFI instruction, for ParseOperands.
@@ -1676,7 +1996,7 @@ class CallFrameInfo::State {
// '8' an eight-byte offset (OPERANDS->offset)
// 'e' a DW_FORM_block holding a (OPERANDS->expression)
// DWARF expression
- bool ParseOperands(const char *format, Operands *operands);
+ bool ParseOperands(const char* format, Operands* operands);
// Interpret one CFI instruction from STATE's instruction stream, update
// STATE, report any rule changes to handler_, and return true. On
@@ -1699,7 +2019,7 @@ class CallFrameInfo::State {
// Specify that REG can be recovered using RULE, and return true. On
// failure, report and return false.
- bool DoRule(unsigned reg, Rule *rule);
+ bool DoRule(unsigned reg, Rule* rule);
// Specify that REG can be found at OFFSET from the CFA, and return true.
// On failure, report and return false. (Subroutine for DW_CFA_offset,
@@ -1727,23 +2047,23 @@ class CallFrameInfo::State {
}
// For reading multi-byte values with the appropriate endianness.
- ByteReader *reader_;
+ ByteReader* reader_;
// The handler to which we should report the data we find.
- Handler *handler_;
+ Handler* handler_;
// For reporting problems in the info we're parsing.
- Reporter *reporter_;
+ Reporter* reporter_;
// The code address to which the next instruction in the stream applies.
uint64_t address_;
// The entry whose instructions we are currently processing. This is
// first a CIE, and then an FDE.
- const Entry *entry_;
+ const Entry* entry_;
// The next instruction to process.
- const uint8_t *cursor_;
+ const uint8_t* cursor_;
// The current set of rules.
RuleMap rules_;
@@ -1758,7 +2078,7 @@ class CallFrameInfo::State {
std::stack<RuleMap> saved_rules_;
};
-bool CallFrameInfo::State::InterpretCIE(const CIE &cie) {
+bool CallFrameInfo::State::InterpretCIE(const CIE& cie) {
entry_ = &cie;
cursor_ = entry_->instructions;
while (cursor_ < entry_->end)
@@ -1770,7 +2090,7 @@ bool CallFrameInfo::State::InterpretCIE(const CIE &cie) {
return true;
}
-bool CallFrameInfo::State::InterpretFDE(const FDE &fde) {
+bool CallFrameInfo::State::InterpretFDE(const FDE& fde) {
entry_ = &fde;
cursor_ = entry_->instructions;
while (cursor_ < entry_->end)
@@ -1779,10 +2099,10 @@ bool CallFrameInfo::State::InterpretFDE(const FDE &fde) {
return true;
}
-bool CallFrameInfo::State::ParseOperands(const char *format,
- Operands *operands) {
+bool CallFrameInfo::State::ParseOperands(const char* format,
+ Operands* operands) {
size_t len;
- const char *operand;
+ const char* operand;
for (operand = format; *operand; operand++) {
size_t bytes_left = entry_->end - cursor_;
@@ -1841,7 +2161,7 @@ bool CallFrameInfo::State::ParseOperands(const char *format,
if (len > bytes_left || expression_length > bytes_left - len)
return ReportIncomplete();
cursor_ += len;
- operands->expression = string(reinterpret_cast<const char *>(cursor_),
+ operands->expression = string(reinterpret_cast<const char*>(cursor_),
expression_length);
cursor_ += expression_length;
break;
@@ -1856,7 +2176,7 @@ bool CallFrameInfo::State::ParseOperands(const char *format,
}
bool CallFrameInfo::State::DoInstruction() {
- CIE *cie = entry_->cie;
+ CIE* cie = entry_->cie;
Operands ops;
// Our entry's kind should have been set by now.
@@ -1946,7 +2266,7 @@ bool CallFrameInfo::State::DoInstruction() {
// Change the base register used to compute the CFA.
case DW_CFA_def_cfa_register: {
if (!ParseOperands("r", &ops)) return false;
- Rule *cfa_rule = rules_.CFARule();
+ Rule* cfa_rule = rules_.CFARule();
if (!cfa_rule) {
if (!DoDefCFA(ops.register_number, ops.offset)) {
reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
@@ -1979,7 +2299,7 @@ bool CallFrameInfo::State::DoInstruction() {
case DW_CFA_def_cfa_expression: {
if (!ParseOperands("e", &ops))
return false;
- Rule *rule = new ValExpressionRule(ops.expression);
+ Rule* rule = new ValExpressionRule(ops.expression);
rules_.SetCFARule(rule);
if (!rule->Handle(handler_, address_,
Handler::kCFARegister))
@@ -2086,7 +2406,7 @@ bool CallFrameInfo::State::DoInstruction() {
CursorOffset());
return false;
}
- const RuleMap &new_rules = saved_rules_.top();
+ const RuleMap& new_rules = saved_rules_.top();
if (rules_.CFARule() && !new_rules.CFARule()) {
reporter_->ClearingCFARule(entry_->offset, entry_->kind,
CursorOffset());
@@ -2138,14 +2458,14 @@ bool CallFrameInfo::State::DoInstruction() {
}
bool CallFrameInfo::State::DoDefCFA(unsigned base_register, long offset) {
- Rule *rule = new ValOffsetRule(base_register, offset);
+ Rule* rule = new ValOffsetRule(base_register, offset);
rules_.SetCFARule(rule);
return rule->Handle(handler_, address_,
Handler::kCFARegister);
}
bool CallFrameInfo::State::DoDefCFAOffset(long offset) {
- Rule *cfa_rule = rules_.CFARule();
+ Rule* cfa_rule = rules_.CFARule();
if (!cfa_rule) {
reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
return false;
@@ -2155,7 +2475,7 @@ bool CallFrameInfo::State::DoDefCFAOffset(long offset) {
Handler::kCFARegister);
}
-bool CallFrameInfo::State::DoRule(unsigned reg, Rule *rule) {
+bool CallFrameInfo::State::DoRule(unsigned reg, Rule* rule) {
rules_.SetRegisterRule(reg, rule);
return rule->Handle(handler_, address_, reg);
}
@@ -2184,7 +2504,7 @@ bool CallFrameInfo::State::DoRestore(unsigned reg) {
reporter_->RestoreInCIE(entry_->offset, CursorOffset());
return false;
}
- Rule *rule = cie_rules_.RegisterRule(reg);
+ Rule* rule = cie_rules_.RegisterRule(reg);
if (!rule) {
// This isn't really the right thing to do, but since CFI generally
// only mentions callee-saves registers, and GCC's convention for
@@ -2195,8 +2515,8 @@ bool CallFrameInfo::State::DoRestore(unsigned reg) {
return DoRule(reg, rule);
}
-bool CallFrameInfo::ReadEntryPrologue(const uint8_t *cursor, Entry *entry) {
- const uint8_t *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_;
@@ -2273,8 +2593,8 @@ bool CallFrameInfo::ReadEntryPrologue(const uint8_t *cursor, Entry *entry) {
return true;
}
-bool CallFrameInfo::ReadCIEFields(CIE *cie) {
- const uint8_t *cursor = cie->fields;
+bool CallFrameInfo::ReadCIEFields(CIE* cie) {
+ const uint8_t* cursor = cie->fields;
size_t len;
assert(cie->kind == kCIE);
@@ -2305,13 +2625,13 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
return false;
}
- const uint8_t *augmentation_start = cursor;
- const uint8_t *augmentation_end =
- reinterpret_cast<const uint8_t *>(memchr(augmentation_start, '\0',
+ 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 = augmentation_end;
- cie->augmentation = string(reinterpret_cast<const char *>(augmentation_start),
+ cie->augmentation = string(reinterpret_cast<const char*>(augmentation_start),
cursor - augmentation_start);
// Skip the terminating '\0'.
cursor++;
@@ -2372,9 +2692,9 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
if (size_t(cie->end - cursor) < len + data_size)
return ReportIncomplete(cie);
cursor += len;
- const uint8_t *data = cursor;
+ const uint8_t* data = cursor;
cursor += data_size;
- const uint8_t *data_end = cursor;
+ const uint8_t* data_end = cursor;
cie->has_z_lsda = false;
cie->has_z_personality = false;
@@ -2465,8 +2785,8 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
return true;
}
-bool CallFrameInfo::ReadFDEFields(FDE *fde) {
- const uint8_t *cursor = fde->fields;
+bool CallFrameInfo::ReadFDEFields(FDE* fde) {
+ const uint8_t* cursor = fde->fields;
size_t size;
fde->address = reader_->ReadEncodedPointer(cursor, fde->cie->pointer_encoding,
@@ -2532,10 +2852,10 @@ bool CallFrameInfo::ReadFDEFields(FDE *fde) {
}
bool CallFrameInfo::Start() {
- const uint8_t *buffer_end = buffer_ + buffer_length_;
- const uint8_t *cursor;
+ const uint8_t* buffer_end = buffer_ + buffer_length_;
+ const uint8_t* cursor;
bool all_ok = true;
- const uint8_t *entry_end;
+ const uint8_t* entry_end;
bool ok;
// Traverse all the entries in buffer_, skipping CIEs and offering
@@ -2666,7 +2986,7 @@ bool CallFrameInfo::Start() {
return all_ok;
}
-const char *CallFrameInfo::KindName(EntryKind kind) {
+const char* CallFrameInfo::KindName(EntryKind kind) {
if (kind == CallFrameInfo::kUnknown)
return "entry";
else if (kind == CallFrameInfo::kCIE)
@@ -2679,7 +2999,7 @@ const char *CallFrameInfo::KindName(EntryKind kind) {
}
}
-bool CallFrameInfo::ReportIncomplete(Entry *entry) {
+bool CallFrameInfo::ReportIncomplete(Entry* entry) {
reporter_->Incomplete(entry->offset, entry->kind);
return false;
}
@@ -2738,7 +3058,7 @@ void CallFrameInfo::Reporter::UnrecognizedVersion(uint64_t offset, int version)
}
void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64_t offset,
- const string &aug) {
+ const string& aug) {
fprintf(stderr,
"%s: CFI frame description entry at offset 0x%" PRIx64 " in '%s':"
" CIE specifies unrecognized augmentation: '%s'\n",
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.h
index 0b194c171ba..e405e3a7013 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader.h
@@ -40,6 +40,7 @@
#ifndef COMMON_DWARF_DWARF2READER_H__
#define COMMON_DWARF_DWARF2READER_H__
+#include <assert.h>
#include <stdint.h>
#include <list>
@@ -63,7 +64,14 @@ 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 uint8_t *, uint64_t> > SectionMap;
+typedef std::map<string, std::pair<const uint8_t*, uint64_t> > SectionMap;
+
+// Abstract away the difference between elf and mach-o section names.
+// Elf-names use ".section_name, mach-o uses "__section_name". Pass "name" in
+// the elf form, ".section_name".
+const SectionMap::const_iterator GetSectionByName(const SectionMap&
+ sections, const char* name);
+
typedef std::list<std::pair<enum DwarfAttribute, enum DwarfForm> >
AttributeList;
typedef AttributeList::iterator AttributeIterator;
@@ -80,7 +88,7 @@ struct LineInfoHeader {
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;
+ std::vector<unsigned char>* std_opcode_lengths;
};
class LineInfo {
@@ -90,8 +98,10 @@ 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 uint8_t *buffer_, uint64_t buffer_length,
- ByteReader* reader, LineInfoHandler* handler);
+ LineInfo(const uint8_t* buffer, uint64_t buffer_length,
+ ByteReader* reader, const uint8_t* string_buffer,
+ size_t string_buffer_length, const uint8_t* line_string_buffer,
+ size_t line_string_buffer_length, LineInfoHandler* handler);
virtual ~LineInfo() {
if (header_.std_opcode_lengths) {
@@ -115,12 +125,12 @@ class LineInfo {
// lsm's old address < PC <= lsm's new address
static bool ProcessOneOpcode(ByteReader* reader,
LineInfoHandler* handler,
- const struct LineInfoHeader &header,
- const uint8_t *start,
+ const struct LineInfoHeader& header,
+ const uint8_t* start,
struct LineStateMachine* lsm,
size_t* len,
uintptr pc,
- bool *lsm_passes_pc);
+ bool* lsm_passes_pc);
private:
// Reads the DWARF2/3 header for this line info.
@@ -129,26 +139,54 @@ class LineInfo {
// Reads the DWARF2/3 line information
void ReadLines();
+ // Read the DWARF5 types and forms for the file and directory tables.
+ void ReadTypesAndForms(const uint8_t** lineptr, uint32_t* content_types,
+ uint32_t* content_forms, uint32_t max_types,
+ uint32_t* format_count);
+
+ // Read a row from the dwarf5 LineInfo file table.
+ void ReadFileRow(const uint8_t** lineptr, const uint32_t* content_types,
+ const uint32_t* content_forms, uint32_t row,
+ uint32_t format_count);
+
+ // Read and return the data at *lineptr according to form. Advance
+ // *lineptr appropriately.
+ uint64_t ReadUnsignedData(uint32_t form, const uint8_t** lineptr);
+
+ // Read and return the data at *lineptr according to form. Advance
+ // *lineptr appropriately.
+ const char* ReadStringForm(uint32_t form, const uint8_t** lineptr);
+
// The associated handler to call processing functions in
LineInfoHandler* handler_;
// The associated ByteReader that handles endianness issues for us
ByteReader* reader_;
- // A DWARF2/3 line info header. This is not the same size as
- // in the actual file, as the one in the file may have a 32 bit or
- // 64 bit lengths
+ // A DWARF line info header. This is not the same size as in the actual file,
+ // as the one in the file may have a 32 bit or 64 bit lengths
struct LineInfoHeader header_;
// 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 uint8_t *buffer_;
+ const uint8_t* buffer_;
#ifndef NDEBUG
uint64_t buffer_length_;
#endif
- const uint8_t *after_header_;
+ // Convenience pointers into .debug_str and .debug_line_str. These exactly
+ // correspond to those in the compilation unit.
+ const uint8_t* string_buffer_;
+#ifndef NDEBUG
+ uint64_t string_buffer_length_;
+#endif
+ const uint8_t* line_string_buffer_;
+#ifndef NDEBUG
+ uint64_t line_string_buffer_length_;
+#endif
+
+ const uint8_t* after_header_;
};
// This class is the main interface between the line info reader and
@@ -205,16 +243,16 @@ class RangeListHandler {
class RangeListReader {
public:
- RangeListReader(const uint8_t *buffer, uint64_t size, ByteReader *reader,
- RangeListHandler *handler);
+ RangeListReader(const uint8_t* buffer, uint64_t size, ByteReader* reader,
+ RangeListHandler* handler);
bool ReadRangeList(uint64_t offset);
private:
- const uint8_t *buffer_;
+ const uint8_t* buffer_;
uint64_t size_;
ByteReader* reader_;
- RangeListHandler *handler_;
+ RangeListHandler* handler_;
};
// This class is the main interface between the reader and the
@@ -288,7 +326,7 @@ class Dwarf2Handler {
virtual void ProcessAttributeBuffer(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const uint8_t *data,
+ const uint8_t* data,
uint64_t len) { }
// Called when we have an attribute with string data to give to our handler.
@@ -410,16 +448,31 @@ class CompilationUnit {
// Reads the DWARF2/3 abbreviations for this compilation unit
void ReadAbbrevs();
+ // Read the abbreviation offset for this compilation unit
+ size_t ReadAbbrevOffset(const uint8_t* headerptr);
+
+ // Read the address size for this compilation unit
+ size_t ReadAddressSize(const uint8_t* headerptr);
+
+ // Read the DWO id from a split or skeleton compilation unit header
+ size_t ReadDwoId(const uint8_t* headerptr);
+
+ // Read the type signature from a type or split type compilation unit header
+ size_t ReadTypeSignature(const uint8_t* headerptr);
+
+ // Read the DWO id from a split or skeleton compilation unit header
+ size_t ReadTypeOffset(const uint8_t* headerptr);
+
// Processes a single DIE for this compilation unit and return a new
// pointer just past the end of it
- const uint8_t *ProcessDIE(uint64_t dieoffset,
- const uint8_t *start,
+ 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 uint8_t *ProcessAttribute(uint64_t dieoffset,
- const uint8_t *start,
+ const uint8_t* ProcessAttribute(uint64_t dieoffset,
+ const uint8_t* start,
enum DwarfAttribute attr,
enum DwarfForm form);
@@ -475,6 +528,14 @@ class CompilationUnit {
handler_->ProcessAttributeBuffer(offset, attr, form, data, len);
}
+ // Handles the common parts of DW_FORM_GNU_str_index, DW_FORM_strx,
+ // DW_FORM_strx1, DW_FORM_strx2, DW_FORM_strx3, and DW_FORM_strx4.
+ // Retrieves the data and calls through to ProcessAttributeString.
+ void ProcessFormStringIndex(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t str_index);
+
// 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
@@ -490,16 +551,28 @@ class CompilationUnit {
handler_->ProcessAttributeString(offset, attr, form, data);
}
+ // Called to handle common portions of DW_FORM_addrx and variations, as well
+ // as DW_FORM_GNU_addr_index.
+ void ProcessAttributeAddrIndex(uint64_t offset,
+ enum DwarfAttribute attr,
+ enum DwarfForm form,
+ uint64_t addr_index) {
+ const uint8_t* addr_ptr =
+ addr_buffer_ + addr_base_ + addr_index * reader_->AddressSize();
+ ProcessAttributeUnsigned(
+ offset, attr, form, reader_->ReadAddress(addr_ptr));
+ }
+
// 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 uint8_t *SkipDIE(const uint8_t *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 uint8_t *SkipAttribute(const uint8_t *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();
@@ -518,9 +591,9 @@ class CompilationUnit {
// 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 uint8_t *buffer_;
+ const uint8_t* buffer_;
uint64_t buffer_length_;
- const uint8_t *after_header_;
+ const uint8_t* after_header_;
// The associated ByteReader that handles endianness issues for us
ByteReader* reader_;
@@ -539,9 +612,13 @@ 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 uint8_t *string_buffer_;
+ const uint8_t* string_buffer_;
uint64_t string_buffer_length_;
+ // Similarly for .debug_line_string.
+ const uint8_t* line_string_buffer_;
+ uint64_t line_string_buffer_length_;
+
// 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_;
@@ -564,6 +641,12 @@ class CompilationUnit {
// The value of the DW_AT_GNU_dwo_id attribute, if any.
uint64_t dwo_id_;
+ // The value of the DW_AT_GNU_type_signature attribute, if any.
+ uint64_t type_signature_;
+
+ // The value of the DW_AT_GNU_type_offset attribute, if any.
+ size_t type_offset_;
+
// The value of the DW_AT_GNU_dwo_name attribute, if any.
const char* dwo_name_;
@@ -905,8 +988,8 @@ 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 uint8_t *buffer, size_t buffer_length,
- ByteReader *reader, Handler *handler, Reporter *reporter,
+ 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),
reader_(reader), handler_(handler), reporter_(reporter),
@@ -920,7 +1003,7 @@ class CallFrameInfo {
bool Start();
// Return the textual name of KIND. For error reporting.
- static const char *KindName(EntryKind kind);
+ static const char* KindName(EntryKind kind);
private:
@@ -933,7 +1016,7 @@ class CallFrameInfo {
size_t offset;
// The start of this entry in the buffer.
- const uint8_t *start;
+ const uint8_t* start;
// Which kind of entry this is.
//
@@ -944,16 +1027,16 @@ 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 uint8_t *fields;
+ const uint8_t* fields;
// The start of this entry's instructions.
- const uint8_t *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 uint8_t *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.
@@ -961,7 +1044,7 @@ class CallFrameInfo {
// The CIE that applies to this entry, if we've parsed it. If this is a
// CIE, then this field points to this structure.
- CIE *cie;
+ CIE* cie;
};
// A common information entry (CIE).
@@ -1035,14 +1118,14 @@ 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 uint8_t *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
// populated; use CIE->fields and CIE->end as the start and limit for
// parsing. On success, populate the rest of *CIE, and return true; on
// failure, report the problem and return false.
- bool ReadCIEFields(CIE *cie);
+ bool ReadCIEFields(CIE* cie);
// Parse the fields of an FDE after the entry prologue, including any 'z'
// augmentation data. Assume that the 'Entry' fields of *FDE are
@@ -1050,12 +1133,12 @@ class CallFrameInfo {
// parsing. Assume that FDE->cie is fully initialized. On success,
// populate the rest of *FDE, and return true; on failure, report the
// problem and return false.
- bool ReadFDEFields(FDE *fde);
+ bool ReadFDEFields(FDE* fde);
// Report that ENTRY is incomplete, and return false. This is just a
// trivial wrapper for invoking reporter_->Incomplete; it provides a
// little brevity.
- bool ReportIncomplete(Entry *entry);
+ bool ReportIncomplete(Entry* entry);
// Return true if ENCODING has the DW_EH_PE_indirect bit set.
static bool IsIndirectEncoding(DwarfPointerEncoding encoding) {
@@ -1063,17 +1146,17 @@ class CallFrameInfo {
}
// The contents of the DWARF .debug_info section we're parsing.
- const uint8_t *buffer_;
+ const uint8_t* buffer_;
size_t buffer_length_;
// For reading multi-byte values with the appropriate endianness.
- ByteReader *reader_;
+ ByteReader* reader_;
// The handler to which we should report the data we find.
- Handler *handler_;
+ Handler* handler_;
// For reporting problems in the info we're parsing.
- Reporter *reporter_;
+ Reporter* reporter_;
// True if we are processing .eh_frame-format data.
bool eh_frame_;
@@ -1106,7 +1189,7 @@ class CallFrameInfo::Handler {
// 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_t address, uint64_t length,
- uint8_t version, const string &augmentation,
+ uint8_t version, const string& augmentation,
unsigned return_address) = 0;
// When the Entry function returns true, the parser calls these
@@ -1155,13 +1238,13 @@ class CallFrameInfo::Handler {
// At ADDRESS, the DWARF expression EXPRESSION yields the address at
// which REG was saved.
virtual bool ExpressionRule(uint64_t address, int reg,
- const string &expression) = 0;
+ 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_t address, int reg,
- const string &expression) = 0;
+ const string& expression) = 0;
// Indicate that the rules for the address range reported by the
// last call to Entry are complete. End should return true if
@@ -1238,8 +1321,8 @@ class CallFrameInfo::Reporter {
// in a Mach-O section named __debug_frame. If we support
// Linux-style exception handling data, we could be reading an
// .eh_frame section.
- Reporter(const string &filename,
- const string &section = ".debug_frame")
+ Reporter(const string& filename,
+ const string& section = ".debug_frame")
: filename_(filename), section_(section) { }
virtual ~Reporter() { }
@@ -1279,7 +1362,7 @@ class CallFrameInfo::Reporter {
// which we don't recognize. We cannot parse DWARF CFI if it uses
// augmentations we don't recognize.
virtual void UnrecognizedAugmentation(uint64_t offset,
- const string &augmentation);
+ const string& augmentation);
// The pointer encoding ENCODING, specified by the CIE at OFFSET, is not
// a valid encoding.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc
index ebe612e1280..8e5d68b4ce7 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc
@@ -87,7 +87,7 @@ using testing::_;
#ifdef WRITE_ELF
void WriteELFFrameSection(const char *filename, const char *section_name,
- const CFISection &section);
+ const CFISection& section);
#define PERHAPS_WRITE_DEBUG_FRAME_FILE(name, section) \
WriteELFFrameSection("cfitest-" name, ".debug_frame", section);
#define PERHAPS_WRITE_EH_FRAME_FILE(name, section) \
@@ -100,7 +100,7 @@ void WriteELFFrameSection(const char *filename, const char *section_name,
class MockCallFrameInfoHandler: public CallFrameInfo::Handler {
public:
MOCK_METHOD6(Entry, bool(size_t offset, uint64_t address, uint64_t length,
- uint8_t version, const string &augmentation,
+ uint8_t version, const string& augmentation,
unsigned return_address));
MOCK_METHOD2(UndefinedRule, bool(uint64_t address, int reg));
MOCK_METHOD2(SameValueRule, bool(uint64_t address, int reg));
@@ -110,9 +110,9 @@ class MockCallFrameInfoHandler: public CallFrameInfo::Handler {
long offset));
MOCK_METHOD3(RegisterRule, bool(uint64_t address, int reg, int base_register));
MOCK_METHOD3(ExpressionRule, bool(uint64_t address, int reg,
- const string &expression));
+ const string& expression));
MOCK_METHOD3(ValExpressionRule, bool(uint64_t address, int reg,
- const string &expression));
+ const string& expression));
MOCK_METHOD0(End, bool());
MOCK_METHOD2(PersonalityRoutine, bool(uint64_t address, bool indirect));
MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64_t address, bool indirect));
@@ -129,7 +129,7 @@ class MockCallFrameErrorReporter: public CallFrameInfo::Reporter {
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(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));
@@ -218,7 +218,7 @@ TEST_F(CFI, IncompleteLength32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size() - 2,
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -244,7 +244,7 @@ TEST_F(CFI, IncompleteLength64) {
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size() - 4,
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -269,7 +269,7 @@ TEST_F(CFI, IncompleteId32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -296,7 +296,7 @@ TEST_F(CFI, BadId32) {
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -318,7 +318,7 @@ TEST_F(CFI, SingleCIE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -349,7 +349,7 @@ TEST_F(CFI, OneFDE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -393,7 +393,7 @@ TEST_F(CFI, TwoFDEsOneCIE) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -443,7 +443,7 @@ TEST_F(CFI, TwoFDEsTwoCIEs) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_LITTLE);
byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -488,7 +488,7 @@ TEST_F(CFI, BadVersion) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -533,7 +533,7 @@ TEST_F(CFI, BadAugmentation) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -568,7 +568,7 @@ TEST_F(CFI, CIEVersion1ReturnColumn) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -603,7 +603,7 @@ TEST_F(CFI, CIEVersion3ReturnColumn) {
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -633,7 +633,7 @@ TEST_F(CFI, CIEVersion4AdditionalFields) {
string contents;
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -663,7 +663,7 @@ TEST_F(CFI, CIEVersion4AdditionalFields32BitAddress) {
string contents;
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_TRUE(parser.Start());
@@ -690,7 +690,7 @@ TEST_F(CFI, CIEVersion4AdditionalFieldsUnexpectedAddressSize) {
string contents;
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -715,7 +715,7 @@ TEST_F(CFI, CIEVersion4AdditionalFieldsUnexpectedSegmentSize) {
string contents;
EXPECT_TRUE(section.GetContents(&contents));
ByteReader byte_reader(ENDIANNESS_BIG);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
EXPECT_FALSE(parser.Start());
@@ -797,7 +797,7 @@ struct CFIInsnFixture: public CFIFixture {
}
ByteReader byte_reader(endianness);
byte_reader.SetAddressSize(section->AddressSize());
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter);
if (succeeds)
@@ -2120,10 +2120,10 @@ struct EHFrameFixture: public CFIInsnFixture {
ByteReader byte_reader(endianness);
byte_reader.SetAddressSize(section->AddressSize());
byte_reader.SetCFIDataBase(encoded_pointer_bases.cfi,
- reinterpret_cast<const uint8_t *>(contents.data()));
+ reinterpret_cast<const uint8_t*>(contents.data()));
byte_reader.SetTextBase(encoded_pointer_bases.text);
byte_reader.SetDataBase(encoded_pointer_bases.data);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
+ CallFrameInfo parser(reinterpret_cast<const uint8_t*>(contents.data()),
contents.size(),
&byte_reader, &handler, &reporter, true);
if (succeeds)
@@ -2468,7 +2468,7 @@ struct ELFSectionHeader {
uint64_t entry_size;
};
-void AppendSectionHeader(CFISection *table, const ELFSectionHeader &header) {
+void AppendSectionHeader(CFISection* table, const ELFSectionHeader& header) {
(*table)
.D32(header.name) // name, index in string tbl
.D32(header.type) // type
@@ -2483,7 +2483,7 @@ void AppendSectionHeader(CFISection *table, const ELFSectionHeader &header) {
}
void WriteELFFrameSection(const char *filename, const char *cfi_name,
- const CFISection &cfi) {
+ const CFISection& cfi) {
int elf_class = cfi.AddressSize() == 4 ? ELFCLASS32 : ELFCLASS64;
int elf_data = (cfi.endianness() == kBigEndian
? ELFDATA2MSB : ELFDATA2LSB);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
index ca44cad00ed..878193224b8 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
@@ -93,7 +93,7 @@ class MockDwarf2Handler: public Dwarf2Handler {
MOCK_METHOD5(ProcessAttributeBuffer, void(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const uint8_t *data,
+ const uint8_t* data,
uint64_t len));
MOCK_METHOD4(ProcessAttributeString, void(uint64_t offset,
enum DwarfAttribute attr,
@@ -128,17 +128,17 @@ struct DIEFixture {
// to |info|, and whose .debug_abbrev section refers to |abbrevs|. This
// function returns a reference to the same SectionMap each time; new
// calls wipe out maps established by earlier calls.
- const SectionMap &MakeSectionMap() {
+ const SectionMap& MakeSectionMap() {
// Copy the sections' contents into strings that will live as long as
// the map itself.
assert(info.GetContents(&info_contents));
assert(abbrevs.GetContents(&abbrevs_contents));
section_map.clear();
section_map[".debug_info"].first
- = reinterpret_cast<const uint8_t *>(info_contents.data());
+ = reinterpret_cast<const uint8_t*>(info_contents.data());
section_map[".debug_info"].second = info_contents.size();
section_map[".debug_abbrev"].first
- = reinterpret_cast<const uint8_t *>(abbrevs_contents.data());
+ = reinterpret_cast<const uint8_t*>(abbrevs_contents.data());
section_map[".debug_abbrev"].second = abbrevs_contents.size();
return section_map;
}
@@ -218,6 +218,8 @@ INSTANTIATE_TEST_CASE_P(
DwarfHeaderParams(kLittleEndian, 8, 3, 8),
DwarfHeaderParams(kLittleEndian, 8, 4, 4),
DwarfHeaderParams(kLittleEndian, 8, 4, 8),
+ DwarfHeaderParams(kLittleEndian, 8, 5, 4),
+ DwarfHeaderParams(kLittleEndian, 8, 5, 8),
DwarfHeaderParams(kBigEndian, 4, 2, 4),
DwarfHeaderParams(kBigEndian, 4, 2, 8),
DwarfHeaderParams(kBigEndian, 4, 3, 4),
@@ -229,14 +231,16 @@ INSTANTIATE_TEST_CASE_P(
DwarfHeaderParams(kBigEndian, 8, 3, 4),
DwarfHeaderParams(kBigEndian, 8, 3, 8),
DwarfHeaderParams(kBigEndian, 8, 4, 4),
- DwarfHeaderParams(kBigEndian, 8, 4, 8)));
+ DwarfHeaderParams(kBigEndian, 8, 4, 8),
+ DwarfHeaderParams(kBigEndian, 8, 5, 4),
+ DwarfHeaderParams(kBigEndian, 8, 5, 8)));
struct DwarfFormsFixture: public DIEFixture {
// Start a compilation unit, as directed by |params|, containing one
// childless DIE of the given tag, with one attribute of the given name
// and form. The 'info' fixture member is left just after the abbrev
// code, waiting for the attribute value to be appended.
- void StartSingleAttributeDIE(const DwarfHeaderParams &params,
+ void StartSingleAttributeDIE(const DwarfHeaderParams& params,
DwarfTag tag, DwarfAttribute name,
DwarfForm form) {
// Create the abbreviation table.
@@ -256,7 +260,7 @@ struct DwarfFormsFixture: public DIEFixture {
// Set up handler to expect a compilation unit matching |params|,
// containing one childless DIE of the given tag, in the sequence s. Stop
// just before the expectations.
- void ExpectBeginCompilationUnit(const DwarfHeaderParams &params,
+ void ExpectBeginCompilationUnit(const DwarfHeaderParams& params,
DwarfTag tag, uint64_t offset=0) {
EXPECT_CALL(handler,
StartCompilationUnit(offset, params.address_size,
@@ -275,7 +279,7 @@ struct DwarfFormsFixture: public DIEFixture {
.WillOnce(Return());
}
- void ParseCompilationUnit(const DwarfHeaderParams &params,
+ void ParseCompilationUnit(const DwarfHeaderParams& params,
uint64_t offset=0) {
ByteReader byte_reader(params.endianness == kLittleEndian ?
ENDIANNESS_LITTLE : ENDIANNESS_BIG);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc
new file mode 100644
index 00000000000..99fc1a0756e
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_lineinfo_unittest.cc
@@ -0,0 +1,187 @@
+// Copyright (c) 2020, 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: Sterling Augustine <saugustine@google.com>
+
+// dwarf2reader_lineinfo_unittest.cc: Unit tests for dwarf2reader::LineInfo
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <string>
+#include <vector>
+
+#include "breakpad_googletest_includes.h"
+#include "common/dwarf/bytereader.h"
+#include "common/dwarf/dwarf2reader.h"
+#include "google_breakpad/common/breakpad_types.h"
+
+using std::vector;
+using testing::InSequence;
+using testing::Return;
+using testing::Sequence;
+using testing::Test;
+using testing::_;
+
+using namespace dwarf2reader;
+
+namespace {
+
+const uint8_t dwarf5_line_program[] = {
+ 0x40, 0x0, 0x0, 0x0, // unit_length (end - begin)
+ // begin
+ 0x05, 0x0, // version
+ 0x8, // address_size
+ 0x0, // segment_selector_size
+ 0x26, 0x0, 0x0, 0x0, // header_length (end_header_end - begin_header)
+ // begin_header:
+ 0x1, // minimum_instruction_length
+ 0x1, // maximum_operations_per_instruction
+ 0x1, // default_is_stmt
+ 0xfb, // line_base
+ 0xe, // line_range
+ 0xd, // opcode_base and lengths
+ 0x0, 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x1,
+ 0x1, // directory entry format count
+ DW_LNCT_path, DW_FORM_strp,
+ 0x1, // directories count
+ 0x1, 0x0, 0x0, 0x0, // offset into .debug_line_str
+ 0x2, // file_name_entry_format_count
+ DW_LNCT_directory_index, DW_FORM_data1,
+ DW_LNCT_path, DW_FORM_line_strp,
+ 0x1, // filename count
+ 0x0, // directory index
+ 0x1, 0x0, 0x0, 0x0, // offset into .debug_str
+ // end_header
+ DW_LNS_set_file, 0x0,
+ // set address to 0x0
+ 0x0, 0x9, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ // Advance Address by 0 and line by 3
+ 0x15,
+ // Advance PC by 1
+ 0x2, 0x1,
+ 0x0,
+ DW_LNE_end_sequence,
+ DW_LNE_end_sequence,
+ // end
+};
+
+const uint8_t dwarf4_line_program[] = {
+ 0x37, 0x0, 0x0, 0x0, // unit_length (end - begin)
+ // begin
+ 0x04, 0x0, // version
+ 0x1d, 0x0, 0x0, 0x0, // header_length (end_header - begin_header)
+ // begin_header:
+ 0x1, // minimum_instruction_length
+ 0x1, // maximum_operations_per_instruction
+ 0x1, // default_is_stmt
+ 0xfb, // line_base
+ 0xe, // line_range
+ 0xd, // opcode_base and lengths
+ 0x0, 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x1,
+ '/', 'a', '\0', // directory entry 1 (zeroth entry implied)
+ '\0', // end of directory table
+ 'b', '/', 'c', '\0', // file entry 1 (zeroth entry implied)
+ 0, // file 1 directory
+ 0, // file 1 modification time
+ 0, // file 1 length
+ '\0', // end of file table
+ // end_header
+ DW_LNS_set_file, 0x0,
+ // set address to 0x0
+ 0x0, 0x9, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ // Advance Address by 0 and line by 3
+ 0x15,
+ // Advance PC by 1
+ 0x2, 0x1,
+ 0x0,
+ DW_LNE_end_sequence,
+ DW_LNE_end_sequence,
+ // end
+};
+
+class MockLineInfoHandler: public LineInfoHandler {
+ public:
+ MOCK_METHOD(void, DefineDir, (const string&, uint32_t dir_num), (override));
+ MOCK_METHOD(void, DefineFile, (const string& name, int32_t file_num,
+ uint32_t dir_num, uint64_t mod_time,
+ uint64_t length), (override));
+ MOCK_METHOD(void, AddLine, (uint64_t address, uint64_t length,
+ uint32_t file_num, uint32_t line_num,
+ uint32_t column_num), (override));
+};
+
+const uint8_t string_section[] = {'x', '/', 'a', '\0'};
+const uint8_t line_string_section[] = {'x', 'b', '/', 'c', '\0' };
+
+struct LineProgram: public Test {
+ MockLineInfoHandler handler_;
+};
+
+TEST_F(LineProgram, ReadLinesDwarf5) {
+ ByteReader byte_reader(ENDIANNESS_LITTLE);
+ // LineTables don't specify the offset size like Compilation Units do.
+ byte_reader.SetOffsetSize(4);
+ LineInfo line_reader(dwarf5_line_program,
+ sizeof(dwarf5_line_program),
+ &byte_reader,
+ string_section,
+ sizeof(string_section),
+ line_string_section,
+ sizeof(line_string_section),
+ &handler_);
+ EXPECT_CALL(handler_, DefineDir("/a", 0)).Times(1);
+ EXPECT_CALL(handler_, DefineFile("b/c", 0, 0, 0, 0)).Times(1);
+ EXPECT_CALL(handler_, AddLine(0, 1, 0, 4, 0)).Times(1);
+ EXPECT_EQ(line_reader.Start(), sizeof(dwarf5_line_program));
+}
+
+TEST_F(LineProgram, ReadLinesDwarf4) {
+ ByteReader byte_reader(ENDIANNESS_LITTLE);
+ // LineTables don't specify the offset size like Compilation Units do.
+ byte_reader.SetOffsetSize(4);
+ // dwarf4 line info headers don't encode the address size.
+ byte_reader.SetAddressSize(8);
+ LineInfo line_reader(dwarf4_line_program,
+ sizeof(dwarf5_line_program),
+ &byte_reader,
+ // dwarf4 line tables can't access the string sections
+ // so pass values likely to make assertions fail if
+ // the code uses them improperly.
+ nullptr, 0, nullptr, 0,
+ &handler_);
+ EXPECT_CALL(handler_, DefineDir("", 0)).Times(1);
+ EXPECT_CALL(handler_, DefineDir("/a", 1)).Times(1);
+ EXPECT_CALL(handler_, DefineFile("", 0, 0, 0, 0)).Times(1);
+ EXPECT_CALL(handler_, DefineFile("b/c", 1, 0, 0, 0)).Times(1);
+ EXPECT_CALL(handler_, AddLine(0, 1, 0, 4, 0)).Times(1);
+ EXPECT_EQ(line_reader.Start(), sizeof(dwarf4_line_program));
+}
+
+} // anonymous namespace
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_test_common.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_test_common.h
index e91de90610d..1934094d0b1 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_test_common.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/dwarf2reader_test_common.h
@@ -57,7 +57,7 @@ class TestCompilationUnit: public google_breakpad::test_assembler::Section {
assert(format_size == 4 || format_size == 8);
format_size_ = format_size;
}
-
+
// Append a DWARF section offset value, of the appropriate size for this
// compilation unit.
template<typename T>
@@ -70,7 +70,7 @@ class TestCompilationUnit: public google_breakpad::test_assembler::Section {
// Append a DWARF compilation unit header to the section, with the given
// DWARF version, abbrev table offset, and address size.
- TestCompilationUnit &Header(int version, const Label &abbrev_offset,
+ TestCompilationUnit& Header(int version, const Label& abbrev_offset,
size_t address_size) {
if (format_size_ == 4) {
D32(length_);
@@ -80,13 +80,19 @@ class TestCompilationUnit: public google_breakpad::test_assembler::Section {
}
post_length_offset_ = Size();
D16(version);
- SectionOffset(abbrev_offset);
- D8(address_size);
+ if (version <= 4) {
+ SectionOffset(abbrev_offset);
+ D8(address_size);
+ } else {
+ D8(0x01); // DW_UT_compile
+ D8(address_size);
+ SectionOffset(abbrev_offset);
+ }
return *this;
}
// Mark the end of this header's DIEs.
- TestCompilationUnit &Finish() {
+ TestCompilationUnit& Finish() {
length_ = Size() - post_length_offset_;
return *this;
}
@@ -116,7 +122,7 @@ class TestAbbrevTable: public google_breakpad::test_assembler::Section {
// Start a new abbreviation table entry for abbreviation code |code|,
// encoding a DIE whose tag is |tag|, and which has children if and only
// if |has_children| is true.
- TestAbbrevTable &Abbrev(int code, DwarfTag tag, DwarfHasChild has_children) {
+ TestAbbrevTable& Abbrev(int code, DwarfTag tag, DwarfHasChild has_children) {
assert(code != 0);
ULEB128(code);
ULEB128(static_cast<unsigned>(tag));
@@ -126,21 +132,21 @@ class TestAbbrevTable: public google_breakpad::test_assembler::Section {
// Add an attribute to the current abbreviation code whose name is |name|
// and whose form is |form|.
- TestAbbrevTable &Attribute(DwarfAttribute name, DwarfForm form) {
+ TestAbbrevTable& Attribute(DwarfAttribute name, DwarfForm form) {
ULEB128(static_cast<unsigned>(name));
ULEB128(static_cast<unsigned>(form));
return *this;
}
// Finish the current abbreviation code.
- TestAbbrevTable &EndAbbrev() {
+ TestAbbrevTable& EndAbbrev() {
ULEB128(0);
ULEB128(0);
return *this;
}
// Finish the current abbreviation table.
- TestAbbrevTable &EndTable() {
+ TestAbbrevTable& EndTable() {
ULEB128(0);
return *this;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
index 1b665213fb6..bbfdba68093 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
@@ -130,11 +130,11 @@ class Elf32 {
static const int kElfClass = ELFCLASS32;
// Given a symbol pointer, return the binding type (eg STB_WEAK).
- static char Bind(const Elf32_Sym *sym) {
+ 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) {
+ static char Type(const Elf32_Sym* sym) {
return ELF32_ST_TYPE(sym->st_info);
}
@@ -158,10 +158,10 @@ class Elf64 {
// What should be in the EI_CLASS header.
static const int kElfClass = ELFCLASS64;
- static char Bind(const Elf64_Sym *sym) {
+ static char Bind(const Elf64_Sym* sym) {
return ELF64_ST_BIND(sym->st_info);
}
- static char Type(const Elf64_Sym *sym) {
+ static char Type(const Elf64_Sym* sym) {
return ELF64_ST_TYPE(sym->st_info);
}
static int r_sym(const Elf64_Xword r_info) {
@@ -182,8 +182,8 @@ class Elf64 {
template<class ElfArch>
class ElfSectionReader {
public:
- ElfSectionReader(const char *name, const string &path, int fd,
- const typename ElfArch::Shdr &section_header)
+ ElfSectionReader(const char* name, const string& path, int fd,
+ const typename ElfArch::Shdr& section_header)
: contents_aligned_(NULL),
contents_(NULL),
header_(section_header) {
@@ -199,7 +199,7 @@ class ElfSectionReader {
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_) +
+ contents_ = reinterpret_cast<char*>(contents_aligned_) +
(header_.sh_offset - offset_aligned);
// Check for and handle any compressed contents.
@@ -217,24 +217,24 @@ class ElfSectionReader {
}
// Return the section header for this section.
- typename ElfArch::Shdr const &header() const { return header_; }
+ 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 {
+ const char* GetOffset(typename ElfArch::Word bytes) const {
return contents_ + bytes;
}
- const char *contents() const { return contents_; }
+ const char* contents() const { return contents_; }
size_t section_size() const { return section_size_; }
private:
// page-aligned file contents
- void *contents_aligned_;
+ 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_;
+ char* contents_;
// size of contents_aligned_
size_t size_aligned_;
// size of contents.
@@ -249,7 +249,7 @@ class ElfSectionReader {
template<class ElfArch>
class SymbolIterator {
public:
- SymbolIterator(ElfReaderImpl<ElfArch> *reader,
+ SymbolIterator(ElfReaderImpl<ElfArch>* reader,
typename ElfArch::Word section_type)
: symbol_section_(reader->GetSectionByType(section_type)),
string_section_(NULL),
@@ -280,7 +280,7 @@ class SymbolIterator {
// Return a pointer to the current symbol.
// REQUIRES: !done()
- const typename ElfArch::Sym *GetSymbol() const {
+ const typename ElfArch::Sym* GetSymbol() const {
return reinterpret_cast<const typename ElfArch::Sym*>(
symbol_section_->GetOffset(symbol_within_section_ *
symbol_section_->header().sh_entsize));
@@ -288,7 +288,7 @@ class SymbolIterator {
// Return the name of the current symbol, NULL if it has none.
// REQUIRES: !done()
- const char *GetSymbolName() const {
+ const char* GetSymbolName() const {
int name_offset = GetSymbol()->st_name;
if (name_offset == 0)
return NULL;
@@ -300,8 +300,8 @@ class SymbolIterator {
}
private:
- const ElfSectionReader<ElfArch> *const symbol_section_;
- const ElfSectionReader<ElfArch> *string_section_;
+ const ElfSectionReader<ElfArch>* const symbol_section_;
+ const ElfSectionReader<ElfArch>* string_section_;
int num_symbols_in_section_;
int symbol_within_section_;
};
@@ -326,7 +326,7 @@ static inline bool MyHasSuffixString(const string& str, const string& suffix) {
template<class ElfArch>
class ElfReaderImpl {
public:
- explicit ElfReaderImpl(const string &path, int fd)
+ explicit ElfReaderImpl(const string& path, int fd)
: path_(path),
fd_(fd),
section_headers_(NULL),
@@ -347,7 +347,7 @@ class ElfReaderImpl {
// "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);
+ 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;
@@ -384,7 +384,7 @@ class ElfReaderImpl {
// 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) {
+ 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";
@@ -415,7 +415,7 @@ class ElfReaderImpl {
}
// Return true if we can use this symbol in Address-to-Symbol map.
- bool CanUseSymbol(const char *name, const typename ElfArch::Sym *sym) {
+ 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
@@ -444,7 +444,7 @@ class ElfReaderImpl {
// Iterate over the symbols in a section, either SHT_DYNSYM or
// SHT_SYMTAB. Add all symbols to the given SymbolMap.
/*
- void GetSymbolPositions(SymbolMap *symbols,
+ void GetSymbolPositions(SymbolMap* symbols,
typename ElfArch::Word section_type,
uint64_t mem_offset,
uint64_t file_offset) {
@@ -453,10 +453,10 @@ class ElfReaderImpl {
AddrToSymMap addr_to_sym_map;
for (SymbolIterator<ElfArch> it(this, section_type);
!it.done(); it.Next()) {
- const char *name = it.GetSymbolName();
+ const char* name = it.GetSymbolName();
if (name == NULL)
continue;
- const typename ElfArch::Sym *sym = it.GetSymbol();
+ const typename ElfArch::Sym* sym = it.GetSymbol();
if (CanUseSymbol(name, sym)) {
const int sec = sym->st_shndx;
@@ -519,9 +519,9 @@ class ElfReaderImpl {
if (addr_to_sym_map.empty()) {
return;
}
- const ElfSectionReader<ElfArch> *const symbol_section =
+ const ElfSectionReader<ElfArch>* const symbol_section =
this->GetSectionByType(section_type);
- const ElfSectionReader<ElfArch> *const string_section =
+ const ElfSectionReader<ElfArch>* const string_section =
this->GetSection(symbol_section->header().sh_link);
typename AddrToSymMap::iterator curr = addr_to_sym_map.begin();
@@ -532,8 +532,8 @@ class ElfReaderImpl {
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;
+ 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:
//
@@ -552,7 +552,7 @@ class ElfReaderImpl {
// (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);
+ const char* name = string_section->GetOffset(curr_sym->st_name);
symbols->AddSymbol(name, curr_addr, curr_sym->st_size);
prev = curr;
} else {
@@ -572,20 +572,20 @@ class ElfReaderImpl {
*/
void VisitSymbols(typename ElfArch::Word section_type,
- ElfReader::SymbolSink *sink) {
+ ElfReader::SymbolSink* sink) {
VisitSymbols(section_type, sink, -1, -1, false);
}
void VisitSymbols(typename ElfArch::Word section_type,
- ElfReader::SymbolSink *sink,
+ 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();
+ const char* name = it.GetSymbolName();
if (!name) continue;
- const typename ElfArch::Sym *sym = it.GetSymbol();
+ 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;
@@ -691,7 +691,7 @@ class ElfReaderImpl {
// 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(
+ 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) {
@@ -703,14 +703,14 @@ class ElfReaderImpl {
// Return the name of section "shndx". Returns NULL if the section
// is not found.
- const char *GetSectionNameByIndex(int shndx) {
+ 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);
+ const char* GetSectionContentsByIndex(int shndx, size_t* size) {
+ const ElfSectionReader<ElfArch>* section = GetSection(shndx);
if (section != NULL) {
*size = section->section_size();
return section->contents();
@@ -721,16 +721,16 @@ class ElfReaderImpl {
// 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) {
+ 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);
+ const char* name = GetSectionName(section_headers_[shndx].sh_name);
if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
- const ElfSectionReader<ElfArch> *section = GetSection(shndx);
+ const ElfSectionReader<ElfArch>* section = GetSection(shndx);
if (section == NULL) {
return NULL;
} else {
@@ -744,16 +744,16 @@ class ElfReaderImpl {
// 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) {
+ 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);
+ const char* name = GetSectionName(section_headers_[shndx].sh_name);
if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
- const ElfSectionReader<ElfArch> *section = GetSection(shndx);
+ const ElfSectionReader<ElfArch>* section = GetSection(shndx);
if (section == NULL) {
return NULL;
} else {
@@ -797,7 +797,7 @@ class ElfReaderImpl {
// 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);
+ 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;
}
@@ -816,7 +816,7 @@ class ElfReaderImpl {
}
private:
- typedef vector<pair<uint64_t, const typename ElfArch::Sym *> > AddrToSymMap;
+ 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) {
@@ -854,8 +854,8 @@ class ElfReaderImpl {
// 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 =
+ const char* GetSectionName(typename ElfArch::Word sh_name) {
+ const ElfSectionReader<ElfArch>* shstrtab =
GetSection(GetStringTableIndex());
if (shstrtab != NULL) {
return shstrtab->GetOffset(sh_name);
@@ -865,15 +865,15 @@ class ElfReaderImpl {
// 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;
+ 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];
+ ElfSectionReader<ElfArch>*& reader = sections_[num];
if (reader == NULL)
reader = new ElfSectionReader<ElfArch>(name, path_, fd_,
section_headers_[num]);
@@ -883,7 +883,7 @@ class ElfReaderImpl {
// 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) {
+ bool ParseHeaders(int fd, const string& path) {
// Read in the global ELF header.
if (pread(fd, &header_, sizeof(header_), 0) != sizeof(header_)) {
return false;
@@ -985,11 +985,11 @@ class ElfReaderImpl {
// Array of GetNumSections() section headers, allocated when we read
// in the global header.
- typename ElfArch::Shdr *section_headers_;
+ typename ElfArch::Shdr* section_headers_;
// Array of GetNumProgramHeaders() program headers, allocated when we read
// in the global header.
- typename ElfArch::Phdr *program_headers_;
+ 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
@@ -1000,7 +1000,7 @@ class ElfReaderImpl {
// 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.
+ const char* opd_section_; // Must be checked for NULL before use.
int64_t base_for_text_;
// Read PLT-related sections for the current architecture.
@@ -1026,7 +1026,7 @@ class ElfReaderImpl {
bool is_dwp_;
};
-ElfReader::ElfReader(const string &path)
+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)
@@ -1063,7 +1063,7 @@ ElfReader::~ElfReader() {
#endif
template <typename ElfArch>
-static bool IsElfFile(const int fd, const string &path) {
+static bool IsElfFile(const int fd, const string& path) {
if (fd < 0)
return false;
if (!ElfReaderImpl<ElfArch>::IsArchElfFile(fd, NULL)) {
@@ -1086,7 +1086,7 @@ bool ElfReader::IsElf64File() const {
}
/*
-void ElfReader::AddSymbols(SymbolMap *symbols,
+void ElfReader::AddSymbols(SymbolMap* symbols,
uint64_t mem_offset, uint64_t file_offset,
uint64_t length) {
if (fd_ < 0)
@@ -1109,17 +1109,17 @@ void ElfReader::AddSymbols(SymbolMap *symbols,
}
*/
-void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink) {
+void ElfReader::VisitSymbols(ElfReader::SymbolSink* sink) {
VisitSymbols(sink, -1, -1);
}
-void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink,
+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,
+void ElfReader::VisitSymbols(ElfReader::SymbolSink* sink,
int symbol_binding,
int symbol_type,
bool get_raw_symbol_values) {
@@ -1148,7 +1148,7 @@ uint64_t ElfReader::VaddrOfFirstLoadSegment() {
}
}
-const char *ElfReader::GetSectionName(int shndx) {
+const char* ElfReader::GetSectionName(int shndx) {
if (shndx < 0 || static_cast<unsigned int>(shndx) >= GetNumSections()) return NULL;
if (IsElf32File()) {
return GetImpl32()->GetSectionNameByIndex(shndx);
@@ -1169,7 +1169,7 @@ uint64_t ElfReader::GetNumSections() {
}
}
-const char *ElfReader::GetSectionByIndex(int shndx, size_t *size) {
+const char* ElfReader::GetSectionByIndex(int shndx, size_t* size) {
if (IsElf32File()) {
return GetImpl32()->GetSectionContentsByIndex(shndx, size);
} else if (IsElf64File()) {
@@ -1179,8 +1179,8 @@ const char *ElfReader::GetSectionByIndex(int shndx, size_t *size) {
}
}
-const char *ElfReader::GetSectionByName(const string &section_name,
- size_t *size) {
+const char* ElfReader::GetSectionByName(const string& section_name,
+ size_t* size) {
if (IsElf32File()) {
return GetImpl32()->GetSectionContentsByName(section_name, size);
} else if (IsElf64File()) {
@@ -1190,8 +1190,8 @@ const char *ElfReader::GetSectionByName(const string &section_name,
}
}
-const char *ElfReader::GetSectionInfoByName(const string &section_name,
- SectionInfo *info) {
+const char* ElfReader::GetSectionInfoByName(const string& section_name,
+ SectionInfo* info) {
if (IsElf32File()) {
return GetImpl32()->GetSectionInfoByName(section_name, info);
} else if (IsElf64File()) {
@@ -1201,7 +1201,7 @@ const char *ElfReader::GetSectionInfoByName(const string &section_name,
}
}
-bool ElfReader::SectionNamesMatch(const string &name, const string &sh_name) {
+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_"));
@@ -1220,14 +1220,14 @@ bool ElfReader::IsDynamicSharedObject() {
}
}
-ElfReaderImpl<Elf32> *ElfReader::GetImpl32() {
+ElfReaderImpl<Elf32>* ElfReader::GetImpl32() {
if (impl32_ == NULL) {
impl32_ = new ElfReaderImpl<Elf32>(path_, fd_);
}
return impl32_;
}
-ElfReaderImpl<Elf64> *ElfReader::GetImpl64() {
+ElfReaderImpl<Elf64>* ElfReader::GetImpl64() {
if (impl64_ == NULL) {
impl64_ = new ElfReaderImpl<Elf64>(path_, fd_);
}
@@ -1238,7 +1238,7 @@ ElfReaderImpl<Elf64> *ElfReader::GetImpl64() {
// 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,
+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);
@@ -1248,7 +1248,7 @@ static bool IsNonStrippedELFBinaryImpl(const string &path, const int fd,
}
// Helper for the IsNon[Debug]StrippedELFBinary functions.
-static bool IsNonStrippedELFBinaryHelper(const string &path,
+static bool IsNonStrippedELFBinaryHelper(const string& path,
bool debug_only) {
const int fd = open(path.c_str(), O_RDONLY);
if (fd == -1) {
@@ -1264,11 +1264,11 @@ static bool IsNonStrippedELFBinaryHelper(const string &path,
return false;
}
-bool ElfReader::IsNonStrippedELFBinary(const string &path) {
+bool ElfReader::IsNonStrippedELFBinary(const string& path) {
return IsNonStrippedELFBinaryHelper(path, false);
}
-bool ElfReader::IsNonDebugStrippedELFBinary(const string &path) {
+bool ElfReader::IsNonDebugStrippedELFBinary(const string& path) {
return IsNonStrippedELFBinaryHelper(path, true);
}
} // namespace dwarf2reader
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.h
index 8eaa5aa903f..0aa922855ad 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.h
@@ -34,7 +34,7 @@ class ElfReaderImpl;
class ElfReader {
public:
- explicit ElfReader(const string &path);
+ explicit ElfReader(const string& path);
~ElfReader();
// Parse the ELF prologue of this file and return whether it was
@@ -62,29 +62,29 @@ class ElfReader {
// 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,
+ 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,
+ 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);
+ 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);
+ 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,
+ 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
@@ -95,7 +95,7 @@ class ElfReader {
// Return the name of section "shndx". Returns NULL if the section
// is not found.
- const char *GetSectionName(int shndx);
+ const char* GetSectionName(int shndx);
// Return the number of sections in the given ELF file.
uint64_t GetNumSections();
@@ -104,14 +104,14 @@ class ElfReader {
// 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);
+ 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);
+ 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
@@ -129,37 +129,37 @@ class ElfReader {
uint64_t addralign; // Section alignment.
uint64_t entsize; // Entry size if section holds a table.
};
- const char *GetSectionInfoByName(const string &section_name,
- SectionInfo *info);
+ 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);
+ 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);
+ 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);
+ static bool SectionNamesMatch(const string& name, const string& sh_name);
private:
// Lazily initialize impl32_ and return it.
- ElfReaderImpl<Elf32> *GetImpl32();
+ ElfReaderImpl<Elf32>* GetImpl32();
// Ditto for impl64_.
- ElfReaderImpl<Elf64> *GetImpl64();
+ 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_;
+ ElfReaderImpl<Elf32>* impl32_;
+ ElfReaderImpl<Elf64>* impl64_;
};
} // namespace dwarf2reader
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/functioninfo.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/functioninfo.cc
index 358a6eeff74..6b9a92a3ff3 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/functioninfo.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/functioninfo.cc
@@ -51,15 +51,9 @@ CULineInfoHandler::CULineInfoHandler(std::vector<SourceFileInfo>* files,
LineMap* linemap):linemap_(linemap),
files_(files),
dirs_(dirs) {
- // The dirs and files are 1 indexed, so just make sure we put
- // nothing in the 0 vector.
- assert(dirs->size() == 0);
- assert(files->size() == 0);
- dirs->push_back("");
- SourceFileInfo s;
- s.name = "";
- s.lowpc = ULLONG_MAX;
- files->push_back(s);
+ // In dwarf4, the dirs and files are 1 indexed, and in dwarf5 they are zero
+ // indexed. This is handled in the LineInfo reader, so empty files are not
+ // needed here.
}
void CULineInfoHandler::DefineDir(const string& name, uint32_t dir_num) {
@@ -150,7 +144,7 @@ bool CUFunctionInfoHandler::StartDIE(uint64_t offset, enum DwarfTag tag) {
void CUFunctionInfoHandler::ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data) {
+ const string& data) {
if (current_function_info_) {
if (attr == DW_AT_name)
current_function_info_->name = data;
@@ -164,7 +158,8 @@ void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64_t offset,
enum DwarfForm form,
uint64_t data) {
if (attr == DW_AT_stmt_list) {
- SectionMap::const_iterator iter = sections_.find("__debug_line");
+ SectionMap::const_iterator iter =
+ GetSectionByName(sections_, ".debug_line");
assert(iter != sections_.end());
scoped_ptr<LineInfo> lireader(new LineInfo(iter->second.first + data,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.cc
index 3dd85edde8e..eb19c132650 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.cc
@@ -143,7 +143,7 @@ vector<string> DwarfCFIToModule::RegisterNames::MIPS() {
}
bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length,
- uint8_t version, const string &augmentation,
+ uint8_t version, const string& augmentation,
unsigned return_address) {
assert(!entry_);
@@ -190,7 +190,7 @@ string DwarfCFIToModule::RegisterName(int i) {
}
void DwarfCFIToModule::Record(Module::Address address, int reg,
- const string &rule) {
+ const string& rule) {
assert(entry_);
// Place the name in our global set of strings, and then use the string
@@ -247,14 +247,14 @@ bool DwarfCFIToModule::RegisterRule(uint64_t address, int reg,
}
bool DwarfCFIToModule::ExpressionRule(uint64_t address, int reg,
- const string &expression) {
+ const string& expression) {
reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
// Treat this as a non-fatal error.
return true;
}
bool DwarfCFIToModule::ValExpressionRule(uint64_t address, int reg,
- const string &expression) {
+ const string& expression) {
reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
// Treat this as a non-fatal error.
return true;
@@ -274,7 +274,7 @@ void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) {
}
void DwarfCFIToModule::Reporter::UndefinedNotSupported(size_t offset,
- const string &reg) {
+ const string& reg) {
fprintf(stderr, "%s, section '%s': "
"the call frame entry at offset 0x%zx sets the rule for "
"register '%s' to 'undefined', but the Breakpad symbol file format"
@@ -283,7 +283,7 @@ void DwarfCFIToModule::Reporter::UndefinedNotSupported(size_t offset,
}
void DwarfCFIToModule::Reporter::ExpressionsNotSupported(size_t offset,
- const string &reg) {
+ const string& reg) {
fprintf(stderr, "%s, section '%s': "
"the call frame entry at offset 0x%zx uses a DWARF expression to"
" describe how to recover register '%s', "
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.h
index 4d2db7eee03..35bdb5fd5a8 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module.h
@@ -71,7 +71,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
// stream. FILE is the name of the file we're processing, and
// SECTION is the name of the section within that file that we're
// looking at (.debug_frame, .eh_frame, etc.).
- Reporter(const string &file, const string &section)
+ Reporter(const string& file, const string& section)
: file_(file), section_(section) { }
virtual ~Reporter() { }
@@ -83,13 +83,13 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
// The DWARF CFI entry at OFFSET says that REG is undefined, but the
// Breakpad symbol file format cannot express this.
- virtual void UndefinedNotSupported(size_t offset, const string &reg);
+ virtual void UndefinedNotSupported(size_t offset, const string& reg);
// The DWARF CFI entry at OFFSET says that REG uses a DWARF
// expression to find its value, but DwarfCFIToModule is not
// capable of translating DWARF expressions to Breakpad postfix
// expressions.
- virtual void ExpressionsNotSupported(size_t offset, const string &reg);
+ virtual void ExpressionsNotSupported(size_t offset, const string& reg);
protected:
string file_, section_;
@@ -118,7 +118,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
private:
// Given STRINGS, an array of C strings with SIZE elements, return an
// equivalent vector<string>.
- static vector<string> MakeVector(const char * const *strings, size_t size);
+ static vector<string> MakeVector(const char* const* strings, size_t size);
};
// Create a handler for the dwarf2reader::CallFrameInfo parser that
@@ -130,15 +130,15 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
//
// Use REPORTER for reporting problems encountered in the conversion
// process.
- DwarfCFIToModule(Module *module, const vector<string> &register_names,
- Reporter *reporter)
+ DwarfCFIToModule(Module* module, const vector<string>& register_names,
+ Reporter* reporter)
: module_(module), register_names_(register_names), reporter_(reporter),
entry_(NULL), return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") {
}
virtual ~DwarfCFIToModule() { delete entry_; }
virtual bool Entry(size_t offset, uint64_t address, uint64_t length,
- uint8_t version, const string &augmentation,
+ uint8_t version, const string& augmentation,
unsigned return_address);
virtual bool UndefinedRule(uint64_t address, int reg);
virtual bool SameValueRule(uint64_t address, int reg);
@@ -148,9 +148,9 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
int base_register, long offset);
virtual bool RegisterRule(uint64_t address, int reg, int base_register);
virtual bool ExpressionRule(uint64_t address, int reg,
- const string &expression);
+ const string& expression);
virtual bool ValExpressionRule(uint64_t address, int reg,
- const string &expression);
+ const string& expression);
virtual bool End();
private:
@@ -158,19 +158,19 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
string RegisterName(int i);
// Record RULE for register REG at ADDRESS.
- void Record(Module::Address address, int reg, const string &rule);
+ void Record(Module::Address address, int reg, const string& rule);
// The module to which we should add entries.
- Module *module_;
+ Module* module_;
// Map from register numbers to register names.
- const vector<string> &register_names_;
+ const vector<string>& register_names_;
// The reporter to use to report problems.
- Reporter *reporter_;
+ Reporter* reporter_;
// The current entry we're constructing.
- Module::StackFrameEntry *entry_;
+ Module::StackFrameEntry* entry_;
// The section offset of the current frame description entry, for
// use in error messages.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module_unittest.cc
index 60a9a3ee47e..58c3cca3a4c 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cfi_to_module_unittest.cc
@@ -47,11 +47,11 @@ using testing::Test;
using testing::_;
struct MockCFIReporter: public DwarfCFIToModule::Reporter {
- MockCFIReporter(const string &file, const string &section)
+ MockCFIReporter(const string& file, const string& section)
: Reporter(file, section) { }
MOCK_METHOD2(UnnamedRegister, void(size_t offset, int reg));
- MOCK_METHOD2(UndefinedNotSupported, void(size_t offset, const string &reg));
- MOCK_METHOD2(ExpressionsNotSupported, void(size_t offset, const string &reg));
+ MOCK_METHOD2(UndefinedNotSupported, void(size_t offset, const string& reg));
+ MOCK_METHOD2(ExpressionsNotSupported, void(size_t offset, const string& reg));
};
struct DwarfCFIToModuleFixture {
@@ -80,7 +80,7 @@ struct DwarfCFIToModuleFixture {
vector<string> register_names;
MockCFIReporter reporter;
DwarfCFIToModule handler;
- vector<Module::StackFrameEntry *> entries;
+ vector<Module::StackFrameEntry*> entries;
};
class Entry: public DwarfCFIToModuleFixture, public Test { };
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.cc
index d6e79769d13..a5bc7d6c3be 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.cc
@@ -128,8 +128,8 @@ struct DwarfCUToModule::FilePrivate {
AbstractOriginByOffset origins;
};
-DwarfCUToModule::FileContext::FileContext(const string &filename,
- Module *module,
+DwarfCUToModule::FileContext::FileContext(const string& filename,
+ Module* module,
bool handle_inter_cu_refs)
: filename_(filename),
module_(module),
@@ -141,7 +141,7 @@ DwarfCUToModule::FileContext::~FileContext() {
}
void DwarfCUToModule::FileContext::AddSectionToSectionMap(
- const string& name, const uint8_t *contents, uint64_t length) {
+ const string& name, const uint8_t* contents, uint64_t length) {
section_map_[name] = std::make_pair(contents, length);
}
@@ -170,8 +170,8 @@ 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,
- RangesHandler *ranges_handler_arg)
+ CUContext(FileContext* file_context_arg, WarningReporter* reporter_arg,
+ RangesHandler* ranges_handler_arg)
: file_context(file_context_arg),
reporter(reporter_arg),
ranges_handler(ranges_handler_arg),
@@ -181,23 +181,23 @@ struct DwarfCUToModule::CUContext {
ranges(0) {}
~CUContext() {
- for (vector<Module::Function *>::iterator it = functions.begin();
+ for (vector<Module::Function*>::iterator it = functions.begin();
it != functions.end(); ++it) {
delete *it;
}
};
// The DWARF-bearing file into which this CU was incorporated.
- FileContext *file_context;
+ FileContext* file_context;
// For printing error messages.
- WarningReporter *reporter;
+ WarningReporter* reporter;
// For reading ranges from the .debug_ranges section
- RangesHandler *ranges_handler;
+ RangesHandler* ranges_handler;
// The source language of this compilation unit.
- const Language *language;
+ 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
@@ -211,11 +211,11 @@ struct DwarfCUToModule::CUContext {
// assign them lines and add them to file_context->module.
//
// Destroying this destroys all the functions this vector points to.
- vector<Module::Function *> functions;
+ 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;
+ std::map<uint64_t, Module::Function*> forward_ref_die_to_func;
};
// Information about the context of a particular DIE. This is for
@@ -241,7 +241,7 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// Create a handler for the DIE at OFFSET whose compilation unit is
// described by CU_CONTEXT, and whose immediate context is described
// by PARENT_CONTEXT.
- GenericDIEHandler(CUContext *cu_context, DIEContext *parent_context,
+ GenericDIEHandler(CUContext* cu_context, DIEContext* parent_context,
uint64_t offset)
: cu_context_(cu_context),
parent_context_(parent_context),
@@ -266,7 +266,7 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// handle DW_AT_specification, or simply not override it.
void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data);
+ const string& data);
protected:
// Compute and return the fully-qualified name of the DIE. If this
@@ -279,8 +279,8 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// have been seen.
string ComputeQualifiedName();
- CUContext *cu_context_;
- DIEContext *parent_context_;
+ CUContext* cu_context_;
+ DIEContext* parent_context_;
uint64_t offset_;
// Place the name in the global set of strings. Even though this looks
@@ -289,7 +289,7 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// share copies of strings whenever possible.
// FIXME: Should this return something like a string_ref to avoid the
// assumption about how strings are implemented?
- string AddStringToPool(const string &str);
+ string AddStringToPool(const string& str);
// If this DIE has a DW_AT_declaration attribute, this is its value.
// It is false on DIEs with no DW_AT_declaration attribute.
@@ -298,7 +298,7 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
// If this DIE has a DW_AT_specification attribute, this is the
// Specification structure for the DIE the attribute refers to.
// Otherwise, this is NULL.
- Specification *specification_;
+ 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
@@ -335,7 +335,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
uint64_t data) {
switch (attr) {
case dwarf2reader::DW_AT_specification: {
- FileContext *file_context = cu_context_->file_context;
+ FileContext* file_context = cu_context_->file_context;
if (file_context->IsUnhandledInterCUReference(
data, cu_context_->reporter->cu_offset())) {
cu_context_->reporter->UnhandledInterCUReference(offset_, data);
@@ -346,7 +346,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
// here, but it's better to leave the real work to our
// EndAttribute member function, at which point we know we have
// seen all the DIE's attributes.
- SpecificationByOffset *specifications =
+ SpecificationByOffset* specifications =
&file_context->file_private_->specifications;
SpecificationByOffset::iterator spec = specifications->find(data);
if (spec != specifications->end()) {
@@ -362,7 +362,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
}
}
-string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string &str) {
+string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string& str) {
pair<unordered_set<string>::iterator, bool> result =
cu_context_->file_context->file_private_->common_strings.insert(str);
return *result.first;
@@ -371,7 +371,7 @@ string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string &str) {
void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString(
enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data) {
+ const string& data) {
switch (attr) {
case dwarf2reader::DW_AT_name:
name_attribute_ = AddStringToPool(data);
@@ -404,7 +404,7 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
// Use the demangled name, if one is available. Demangled names are
// preferable to those inferred from the DWARF structure because they
// include argument types.
- const string *qualified_name = NULL;
+ const string* qualified_name = NULL;
if (!demangled_name_.empty()) {
// Found it is this DIE.
qualified_name = &demangled_name_;
@@ -413,8 +413,8 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
qualified_name = &specification_->qualified_name;
}
- const string *unqualified_name = NULL;
- const string *enclosing_name;
+ const string* unqualified_name = NULL;
+ const string* enclosing_name;
if (!qualified_name) {
// Find the unqualified name. If the DIE has its own DW_AT_name
// attribute, then use that; otherwise, check the specification.
@@ -466,7 +466,7 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
// A handler class for DW_TAG_subprogram DIEs.
class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
public:
- FuncHandler(CUContext *cu_context, DIEContext *parent_context,
+ FuncHandler(CUContext* cu_context, DIEContext* parent_context,
uint64_t offset)
: GenericDIEHandler(cu_context, parent_context, offset),
low_pc_(0), high_pc_(0), high_pc_form_(dwarf2reader::DW_FORM_addr),
@@ -593,14 +593,19 @@ void DwarfCUToModule::FuncHandler::Finish() {
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_form_ != dwarf2reader::DW_FORM_GNU_addr_index &&
+ high_pc_form_ != dwarf2reader::DW_FORM_addrx &&
+ high_pc_form_ != dwarf2reader::DW_FORM_addrx1 &&
+ high_pc_form_ != dwarf2reader::DW_FORM_addrx2 &&
+ high_pc_form_ != dwarf2reader::DW_FORM_addrx3 &&
+ high_pc_form_ != dwarf2reader::DW_FORM_addrx4) {
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;
+ RangesHandler* ranges_handler = cu_context_->ranges_handler;
if (ranges_handler) {
if (!ranges_handler->ReadRanges(ranges_, cu_context_->low_pc, &ranges)) {
@@ -663,11 +668,11 @@ void DwarfCUToModule::FuncHandler::Finish() {
// component to their names: namespaces, classes, etc.
class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler {
public:
- NamedScopeHandler(CUContext *cu_context, DIEContext *parent_context,
+ NamedScopeHandler(CUContext* cu_context, DIEContext* parent_context,
uint64_t offset)
: GenericDIEHandler(cu_context, parent_context, offset) { }
bool EndAttributes();
- DIEHandler *FindChildHandler(uint64_t offset, enum DwarfTag tag);
+ DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag);
private:
DIEContext child_context_; // A context for our children.
@@ -678,7 +683,7 @@ bool DwarfCUToModule::NamedScopeHandler::EndAttributes() {
return true;
}
-dwarf2reader::DIEHandler *DwarfCUToModule::NamedScopeHandler::FindChildHandler(
+dwarf2reader::DIEHandler* DwarfCUToModule::NamedScopeHandler::FindChildHandler(
uint64_t offset,
enum DwarfTag tag) {
switch (tag) {
@@ -720,7 +725,7 @@ void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64_t offset,
filename_.c_str(), offset, target);
}
-void DwarfCUToModule::WarningReporter::MissingSection(const string &name) {
+void DwarfCUToModule::WarningReporter::MissingSection(const string& name) {
CUHeading();
fprintf(stderr, "%s: warning: couldn't find DWARF '%s' section\n",
filename_.c_str(), name.c_str());
@@ -743,7 +748,7 @@ void DwarfCUToModule::WarningReporter::UncoveredHeading() {
}
void DwarfCUToModule::WarningReporter::UncoveredFunction(
- const Module::Function &function) {
+ const Module::Function& function) {
if (!uncovered_warnings_enabled_)
return;
UncoveredHeading();
@@ -752,7 +757,7 @@ void DwarfCUToModule::WarningReporter::UncoveredFunction(
function.name.c_str());
}
-void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line &line) {
+void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line& line) {
if (!uncovered_warnings_enabled_)
return;
UncoveredHeading();
@@ -767,7 +772,7 @@ void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64_t offset) {
filename_.c_str(), offset);
}
-void DwarfCUToModule::WarningReporter::DemangleError(const string &input) {
+void DwarfCUToModule::WarningReporter::DemangleError(const string& input) {
CUHeading();
fprintf(stderr, "%s: warning: failed to demangle %s\n",
filename_.c_str(), input.c_str());
@@ -795,10 +800,10 @@ void DwarfCUToModule::WarningReporter::MissingRanges() {
"the .debug_ranges section is missing.\n", filename_.c_str());
}
-DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
- LineToModuleHandler *line_reader,
- RangesHandler *ranges_handler,
- WarningReporter *reporter)
+DwarfCUToModule::DwarfCUToModule(FileContext* file_context,
+ LineToModuleHandler* line_reader,
+ RangesHandler* ranges_handler,
+ WarningReporter* reporter)
: line_reader_(line_reader),
cu_context_(new CUContext(file_context, reporter, ranges_handler)),
child_context_(new DIEContext()),
@@ -848,7 +853,7 @@ void DwarfCUToModule::ProcessAttributeUnsigned(enum DwarfAttribute attr,
void DwarfCUToModule::ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data) {
+ const string& data) {
switch (attr) {
case dwarf2reader::DW_AT_name:
cu_context_->reporter->SetCUName(data);
@@ -865,7 +870,7 @@ bool DwarfCUToModule::EndAttributes() {
return true;
}
-dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
+dwarf2reader::DIEHandler* DwarfCUToModule::FindChildHandler(
uint64_t offset,
enum DwarfTag tag) {
switch (tag) {
@@ -927,55 +932,72 @@ void DwarfCUToModule::SetLanguage(DwarfLanguage language) {
}
void DwarfCUToModule::ReadSourceLines(uint64_t offset) {
- const dwarf2reader::SectionMap &section_map
+ const dwarf2reader::SectionMap& section_map
= cu_context_->file_context->section_map();
dwarf2reader::SectionMap::const_iterator map_entry
- = section_map.find(".debug_line");
- // Mac OS X puts DWARF data in sections whose names begin with "__"
- // instead of ".".
- if (map_entry == section_map.end())
- map_entry = section_map.find("__debug_line");
+ = dwarf2reader::GetSectionByName(section_map, ".debug_line");
if (map_entry == section_map.end()) {
cu_context_->reporter->MissingSection(".debug_line");
return;
}
- const uint8_t *section_start = map_entry->second.first;
- uint64_t section_length = map_entry->second.second;
- if (offset >= section_length) {
+ const uint8_t* line_section_start = map_entry->second.first + offset;
+ uint64_t line_section_length = map_entry->second.second;
+ if (offset >= line_section_length) {
cu_context_->reporter->BadLineInfoOffset(offset);
return;
}
- line_reader_->ReadProgram(section_start + offset, section_length - offset,
- cu_context_->file_context->module_, &lines_);
+ line_section_length -= offset;
+ // When reading line tables, string sections are never needed for dwarf4, and
+ // may or may not be needed by dwarf5, so no error if they are missing.
+ const uint8_t* string_section_start = nullptr;
+ uint64_t string_section_length = 0;
+ map_entry = dwarf2reader::GetSectionByName(section_map, ".debug_str");
+ if (map_entry != section_map.end()) {
+ string_section_start = map_entry->second.first + offset;
+ string_section_length = map_entry->second.second - offset;
+ }
+ const uint8_t* line_string_section_start = nullptr;
+ uint64_t line_string_section_length = 0;
+ map_entry = dwarf2reader::GetSectionByName(section_map, ".debug_line_str");
+ if (map_entry != section_map.end()) {
+ line_string_section_start = map_entry->second.first + offset;
+ line_string_section_length = map_entry->second.second - offset;
+ return;
+ }
+ line_reader_->ReadProgram(
+ line_section_start, line_section_length,
+ string_section_start, string_section_length,
+ line_string_section_start, line_string_section_length,
+ cu_context_->file_context->module_, &lines_);
}
namespace {
class FunctionRange {
public:
- FunctionRange(const Module::Range &range, Module::Function *function) :
+ FunctionRange(const Module::Range& range, Module::Function* function) :
address(range.address), size(range.size), function(function) { }
- void AddLine(Module::Line &line) {
+ void AddLine(Module::Line& line) {
function->lines.push_back(line);
}
Module::Address address;
Module::Address size;
- Module::Function *function;
+ 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();
+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;
+ 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) {
@@ -987,7 +1009,7 @@ static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges,
}
sort(dest_ranges.begin(), dest_ranges.end(),
- [](const FunctionRange &fr1, const FunctionRange &fr2) {
+ [](const FunctionRange& fr1, const FunctionRange& fr2) {
return fr1.address < fr2.address;
}
);
@@ -995,7 +1017,7 @@ static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges,
// Return true if ADDRESS falls within the range of ITEM.
template <class T>
-inline bool within(const T &item, Module::Address address) {
+inline bool within(const T& item, Module::Address address) {
// Because Module::Address is unsigned, and unsigned arithmetic
// wraps around, this will be false if ADDRESS falls before the
// start of ITEM, or if it falls after ITEM's end.
@@ -1004,8 +1026,8 @@ inline bool within(const T &item, Module::Address address) {
}
void DwarfCUToModule::AssignLinesToFunctions() {
- vector<Module::Function *> *functions = &cu_context_->functions;
- WarningReporter *reporter = cu_context_->reporter;
+ vector<Module::Function*>* functions = &cu_context_->functions;
+ WarningReporter* reporter = cu_context_->reporter;
// This would be simpler if we assumed that source line entries
// don't cross function boundaries. However, there's no real reason
@@ -1025,12 +1047,12 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// The last line that we used any piece of. We use this only for
// generating warnings.
- const Module::Line *last_line_used = NULL;
+ const Module::Line* last_line_used = NULL;
// The last function and line we warned about --- so we can avoid
// doing so more than once.
- const Module::Function *last_function_cited = NULL;
- const Module::Line *last_line_cited = NULL;
+ const Module::Function* last_function_cited = NULL;
+ const Module::Line* last_line_cited = NULL;
// Prepare a sorted list of ranges with range-to-function mapping
vector<FunctionRange> sorted_ranges;
@@ -1046,8 +1068,8 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// Pointers to the referents of func_it and line_it, or NULL if the
// iterator is at the end of the sequence.
- FunctionRange *range;
- const Module::Line *line;
+ FunctionRange* range;
+ const Module::Line* line;
// Start current at the beginning of the first line or function,
// whichever is earlier.
@@ -1067,6 +1089,11 @@ void DwarfCUToModule::AssignLinesToFunctions() {
return;
}
+ // Some dwarf producers handle linker-removed functions by using -1 as a
+ // tombstone in the line table. So the end marker can be -1.
+ if (current == Module::kMaxAddress)
+ return;
+
while (range || line) {
// This loop has two invariants that hold at the top.
//
@@ -1173,7 +1200,10 @@ void DwarfCUToModule::AssignLinesToFunctions() {
// next_transition may end up being zero, in which case we've completed
// our pass. Handle that here, instead of trying to deal with it in
// each place we compute next_transition.
- if (!next_transition)
+
+ // Some dwarf producers handle linker-removed functions by using -1 as a
+ // tombstone in the line table. So the end marker can be -1.
+ if (!next_transition || next_transition == Module::kMaxAddress)
break;
// Advance iterators as needed. If lines overlap or functions overlap,
@@ -1210,7 +1240,7 @@ void DwarfCUToModule::Finish() {
if (has_source_line_info_)
ReadSourceLines(source_line_offset_);
- vector<Module::Function *> *functions = &cu_context_->functions;
+ vector<Module::Function*>* functions = &cu_context_->functions;
// Dole out lines to the appropriate functions.
AssignLinesToFunctions();
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.h
index 2153bd96ac5..3e15b667535 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module.h
@@ -79,14 +79,14 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// to true to handle debugging symbols with DW_FORM_ref_addr entries.
class FileContext {
public:
- FileContext(const string &filename,
- Module *module,
+ FileContext(const string& filename,
+ Module* module,
bool handle_inter_cu_refs);
~FileContext();
// Add CONTENTS of size LENGTH to the section map as NAME.
void AddSectionToSectionMap(const string& name,
- const uint8_t *contents,
+ const uint8_t* contents,
uint64_t length);
// Clear the section map for testing.
@@ -114,7 +114,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
dwarf2reader::SectionMap section_map_;
// The Module to which we're contributing definitions.
- Module *module_;
+ Module* module_;
// True if we are handling references between compilation units.
const bool handle_inter_cu_refs_;
@@ -158,8 +158,12 @@ 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 uint8_t *program, uint64_t length,
- Module *module, vector<Module::Line> *lines) = 0;
+ virtual void ReadProgram(const uint8_t* program, uint64_t length,
+ const uint8_t* string_section,
+ uint64_t string_section_length,
+ const uint8_t* line_string_section,
+ uint64_t line_string_length,
+ Module* module, vector<Module::Line>* lines) = 0;
};
// The interface DwarfCUToModule uses to report warnings. The member
@@ -170,14 +174,14 @@ 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_t 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) { }
virtual ~WarningReporter() { }
// Set the name of the compilation unit we're processing to NAME.
- virtual void SetCUName(const string &name) { cu_name_ = name; }
+ virtual void SetCUName(const string& name) { cu_name_ = name; }
// Accessor and setter for uncovered_warnings_enabled_.
// UncoveredFunction and UncoveredLine only report a problem if that is
@@ -200,17 +204,17 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
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);
+ virtual void MissingSection(const string& section_name);
// The CU's DW_AT_stmt_list offset OFFSET is bogus.
virtual void BadLineInfoOffset(uint64_t offset);
// FUNCTION includes code covered by no line number data.
- virtual void UncoveredFunction(const Module::Function &function);
+ virtual void UncoveredFunction(const Module::Function& function);
// Line number NUMBER in LINE_FILE, of length LENGTH, includes code
// covered by no function.
- virtual void UncoveredLine(const Module::Line &line);
+ virtual void UncoveredLine(const Module::Line& line);
// 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
@@ -218,7 +222,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
virtual void UnnamedFunction(uint64_t offset);
// __cxa_demangle() failed to demangle INPUT.
- virtual void DemangleError(const string &input);
+ 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.
@@ -257,10 +261,10 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// FILE_CONTEXT->module. Use LINE_READER to handle the compilation
// unit's line number data. Use REPORTER to report problems with the
// data we find.
- DwarfCUToModule(FileContext *file_context,
- LineToModuleHandler *line_reader,
- RangesHandler *ranges_handler,
- WarningReporter *reporter);
+ DwarfCUToModule(FileContext* file_context,
+ LineToModuleHandler* line_reader,
+ RangesHandler* ranges_handler,
+ WarningReporter* reporter);
~DwarfCUToModule();
void ProcessAttributeSigned(enum DwarfAttribute attr,
@@ -271,9 +275,9 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
uint64_t data);
void ProcessAttributeString(enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data);
+ const string& data);
bool EndAttributes();
- DIEHandler *FindChildHandler(uint64_t 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_.
@@ -319,7 +323,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
// destructor deletes them.
// The handler to use to handle line number data.
- LineToModuleHandler *line_reader_;
+ LineToModuleHandler* line_reader_;
// This compilation unit's context.
scoped_ptr<CUContext> cu_context_;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module_unittest.cc
index ed1d7c9b30e..8545c67d420 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_cu_to_module_unittest.cc
@@ -67,23 +67,27 @@ using ::testing::ValuesIn;
class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler {
public:
MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir));
- MOCK_METHOD4(ReadProgram, void(const uint8_t *program, uint64_t length,
- Module *module, vector<Module::Line> *lines));
+ MOCK_METHOD8(ReadProgram, void(const uint8_t* program, uint64_t length,
+ const uint8_t* string_section,
+ uint64_t string_section_length,
+ const uint8_t* line_string_section,
+ uint64_t line_string_section_length,
+ Module* module, vector<Module::Line>* lines));
};
class MockWarningReporter: public DwarfCUToModule::WarningReporter {
public:
- MockWarningReporter(const string &filename, uint64_t cu_offset)
+ MockWarningReporter(const string& filename, uint64_t cu_offset)
: DwarfCUToModule::WarningReporter(filename, cu_offset) { }
- MOCK_METHOD1(SetCUName, void(const string &name));
+ MOCK_METHOD1(SetCUName, void(const string& name));
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(MissingSection, void(const string& section_name));
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(UncoveredFunction, void(const Module::Function& function));
+ MOCK_METHOD1(UncoveredLine, void(const Module::Line& line));
MOCK_METHOD1(UnnamedFunction, void(uint64_t offset));
- MOCK_METHOD1(DemangleError, void(const string &input));
+ MOCK_METHOD1(DemangleError, void(const string& input));
MOCK_METHOD2(UnhandledInterCUReference, void(uint64_t offset, uint64_t target));
};
@@ -112,13 +116,17 @@ class CUFixtureBase {
class AppendLinesFunctor {
public:
explicit AppendLinesFunctor(
- const vector<Module::Line> *lines) : lines_(lines) { }
- void operator()(const uint8_t *program, uint64_t length,
- Module *module, vector<Module::Line> *lines) {
+ const vector<Module::Line>* lines) : lines_(lines) { }
+ void operator()(const uint8_t* program, uint64_t length,
+ const uint8_t* string_section,
+ uint64_t string_section_length,
+ const uint8_t* line_string_section,
+ uint64_t line_string_section_length,
+ Module *module, vector<Module::Line>* lines) {
lines->insert(lines->end(), lines_->begin(), lines_->end());
}
private:
- const vector<Module::Line> *lines_;
+ const vector<Module::Line>* lines_;
};
CUFixtureBase()
@@ -147,7 +155,7 @@ class CUFixtureBase {
// By default, expect the line program reader not to be invoked. We
// may override this in StartCU.
EXPECT_CALL(line_reader_, StartCompilationUnit(_)).Times(0);
- EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_)).Times(0);
+ EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_,_,_,_,_)).Times(0);
// The handler will consult this section map to decide what to
// pass to our line reader.
@@ -161,7 +169,7 @@ class CUFixtureBase {
// when it invokes its LineToModuleHandler. Call this before calling
// StartCU.
void PushLine(Module::Address address, Module::Address size,
- const string &filename, int line_number);
+ const string& filename, int line_number);
// Use LANGUAGE for the compilation unit. More precisely, arrange
// for StartCU to pass the compilation unit's root DIE a
@@ -182,28 +190,28 @@ class CUFixtureBase {
void StartCU();
// Have HANDLER process some strange attribute/form/value triples.
- void ProcessStrangeAttributes(dwarf2reader::DIEHandler *handler);
+ void ProcessStrangeAttributes(dwarf2reader::DIEHandler* handler);
// Start a child DIE of PARENT with the given tag and name. Leave
// the handler ready to hear about children: call EndAttributes, but
// not Finish.
- DIEHandler *StartNamedDIE(DIEHandler *parent, DwarfTag tag,
- const string &name);
+ DIEHandler* StartNamedDIE(DIEHandler* parent, DwarfTag tag,
+ const string& name);
// Start a child DIE of PARENT with the given tag and a
// DW_AT_specification attribute whose value is SPECIFICATION. Leave
// the handler ready to hear about children: call EndAttributes, but
// not Finish. If NAME is non-zero, use it as the DW_AT_name
// attribute.
- DIEHandler *StartSpecifiedDIE(DIEHandler *parent, DwarfTag tag,
- uint64_t specification, const char *name = NULL);
+ DIEHandler* StartSpecifiedDIE(DIEHandler* parent, DwarfTag tag,
+ 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
// will be written as an address; otherwise it will be written as the
// function's size. Call EndAttributes and Finish; one cannot define
// children of the defined function's DIE.
- void DefineFunction(DIEHandler *parent, const string &name,
+ void DefineFunction(DIEHandler* parent, const string& name,
Module::Address address, Module::Address size,
const char* mangled_name,
DwarfForm high_pc_form = dwarf2reader::DW_FORM_addr);
@@ -211,32 +219,32 @@ 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_t offset,
- DwarfTag tag, const string &name,
- const string &mangled_name);
+ void DeclarationDIE(DIEHandler* parent, uint64_t offset,
+ DwarfTag tag, const string& name,
+ const string& mangled_name);
// Create a definition DIE as a child of PARENT with the given tag
// that refers to the declaration DIE at offset SPECIFICATION as its
// specification. If NAME is non-empty, pass it as the DW_AT_name
// attribute. If SIZE is non-zero, record ADDRESS and SIZE as
// low_pc/high_pc attributes.
- void DefinitionDIE(DIEHandler *parent, DwarfTag tag,
- uint64_t specification, const string &name,
+ void DefinitionDIE(DIEHandler* parent, DwarfTag tag,
+ 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_t offset,
+ void AbstractInstanceDIE(DIEHandler* parent, uint64_t offset,
DwarfInline type, uint64_t specification,
- const string &name,
+ const string& name,
DwarfForm form = dwarf2reader::DW_FORM_data1);
// Create a DW_TAG_subprogram DIE as a child of PARENT that refers to
// 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,
+ void DefineInlineInstanceDIE(DIEHandler* parent, const string& name,
uint64_t origin, Module::Address address,
Module::Address size);
@@ -251,7 +259,7 @@ class CUFixtureBase {
// Test that the I'th function (ordered by address) in the module
// this.module_ has the given name, address, and size, and that its
// parameter size is zero.
- void TestFunction(int i, const string &name,
+ void TestFunction(int i, const string& name,
Module::Address address, Module::Address size);
// Test that the number of source lines owned by the I'th function
@@ -262,7 +270,7 @@ class CUFixtureBase {
// (again, by address) has the given address, size, filename, and
// line number.
void TestLine(int i, int j, Module::Address address, Module::Address size,
- const string &filename, int number);
+ const string& filename, int number);
// Actual objects under test.
Module module_;
@@ -300,7 +308,7 @@ class CUFixtureBase {
// If functions_filled_ is true, this is a table of functions we've
// extracted from module_, sorted by address.
- vector<Module::Function *> functions_;
+ vector<Module::Function*> functions_;
// True if we have filled the above vector with this.module_'s function list.
bool functions_filled_;
};
@@ -310,7 +318,7 @@ const size_t CUFixtureBase::dummy_line_size_ =
sizeof(CUFixtureBase::dummy_line_program_);
void CUFixtureBase::PushLine(Module::Address address, Module::Address size,
- const string &filename, int line_number) {
+ const string& filename, int line_number) {
Module::Line l;
l.address = address;
l.size = size;
@@ -332,10 +340,10 @@ void CUFixtureBase::StartCU() {
if (!lines_.empty())
EXPECT_CALL(line_reader_,
ReadProgram(&dummy_line_program_[0], dummy_line_size_,
+ _,_,_,_,
&module_, _))
.Times(AtMost(1))
.WillOnce(DoAll(Invoke(appender_), Return()));
-
ASSERT_TRUE(root_handler_
.StartCompilationUnit(0x51182ec307610b51ULL, 0x81, 0x44,
0x4241b4f33720dd5cULL, 3));
@@ -368,7 +376,7 @@ void CUFixtureBase::StartCU() {
}
void CUFixtureBase::ProcessStrangeAttributes(
- dwarf2reader::DIEHandler *handler) {
+ dwarf2reader::DIEHandler* handler) {
handler->ProcessAttributeUnsigned((DwarfAttribute) 0xf560dead,
(DwarfForm) 0x4106e4db,
0xa592571997facda1ULL);
@@ -387,10 +395,10 @@ void CUFixtureBase::ProcessStrangeAttributes(
"strange string");
}
-DIEHandler *CUFixtureBase::StartNamedDIE(DIEHandler *parent,
+DIEHandler* CUFixtureBase::StartNamedDIE(DIEHandler* parent,
DwarfTag tag,
- const string &name) {
- dwarf2reader::DIEHandler *handler
+ const string& name) {
+ dwarf2reader::DIEHandler* handler
= parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
if (!handler)
return NULL;
@@ -407,11 +415,11 @@ DIEHandler *CUFixtureBase::StartNamedDIE(DIEHandler *parent,
return handler;
}
-DIEHandler *CUFixtureBase::StartSpecifiedDIE(DIEHandler *parent,
+DIEHandler* CUFixtureBase::StartSpecifiedDIE(DIEHandler* parent,
DwarfTag tag,
uint64_t specification,
- const char *name) {
- dwarf2reader::DIEHandler *handler
+ const char* name) {
+ dwarf2reader::DIEHandler* handler
= parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
if (!handler)
return NULL;
@@ -431,12 +439,12 @@ DIEHandler *CUFixtureBase::StartSpecifiedDIE(DIEHandler *parent,
return handler;
}
-void CUFixtureBase::DefineFunction(dwarf2reader::DIEHandler *parent,
- const string &name, Module::Address address,
+void CUFixtureBase::DefineFunction(dwarf2reader::DIEHandler* parent,
+ const string& name, Module::Address address,
Module::Address size,
const char* mangled_name,
DwarfForm high_pc_form) {
- dwarf2reader::DIEHandler *func
+ dwarf2reader::DIEHandler* func
= parent->FindChildHandler(0xe34797c7e68590a8LL,
dwarf2reader::DW_TAG_subprogram);
ASSERT_TRUE(func != NULL);
@@ -466,11 +474,11 @@ void CUFixtureBase::DefineFunction(dwarf2reader::DIEHandler *parent,
delete func;
}
-void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64_t offset,
+void CUFixtureBase::DeclarationDIE(DIEHandler* parent, uint64_t offset,
DwarfTag tag,
- const string &name,
- const string &mangled_name) {
- dwarf2reader::DIEHandler *die = parent->FindChildHandler(offset, tag);
+ const string& name,
+ const string& mangled_name) {
+ dwarf2reader::DIEHandler* die = parent->FindChildHandler(offset, tag);
ASSERT_TRUE(die != NULL);
if (!name.empty())
die->ProcessAttributeString(dwarf2reader::DW_AT_name,
@@ -489,13 +497,13 @@ void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64_t offset,
delete die;
}
-void CUFixtureBase::DefinitionDIE(DIEHandler *parent,
+void CUFixtureBase::DefinitionDIE(DIEHandler* parent,
DwarfTag tag,
uint64_t specification,
- const string &name,
+ const string& name,
Module::Address address,
Module::Address size) {
- dwarf2reader::DIEHandler *die
+ dwarf2reader::DIEHandler* die
= parent->FindChildHandler(0x6ccfea031a9e6cc9ULL, tag);
ASSERT_TRUE(die != NULL);
die->ProcessAttributeReference(dwarf2reader::DW_AT_specification,
@@ -518,13 +526,13 @@ void CUFixtureBase::DefinitionDIE(DIEHandler *parent,
delete die;
}
-void CUFixtureBase::AbstractInstanceDIE(DIEHandler *parent,
+void CUFixtureBase::AbstractInstanceDIE(DIEHandler* parent,
uint64_t offset,
DwarfInline type,
uint64_t specification,
- const string &name,
+ const string& name,
DwarfForm form) {
- dwarf2reader::DIEHandler *die
+ dwarf2reader::DIEHandler* die
= parent->FindChildHandler(offset, dwarf2reader::DW_TAG_subprogram);
ASSERT_TRUE(die != NULL);
if (specification != 0ULL)
@@ -546,12 +554,12 @@ void CUFixtureBase::AbstractInstanceDIE(DIEHandler *parent,
delete die;
}
-void CUFixtureBase::DefineInlineInstanceDIE(DIEHandler *parent,
- const string &name,
+void CUFixtureBase::DefineInlineInstanceDIE(DIEHandler* parent,
+ const string& name,
uint64_t origin,
Module::Address address,
Module::Address size) {
- dwarf2reader::DIEHandler *func
+ dwarf2reader::DIEHandler* func
= parent->FindChildHandler(0x11c70f94c6e87ccdLL,
dwarf2reader::DW_TAG_subprogram);
ASSERT_TRUE(func != NULL);
@@ -589,13 +597,13 @@ void CUFixtureBase::TestFunctionCount(size_t expected) {
ASSERT_EQ(expected, functions_.size());
}
-void CUFixtureBase::TestFunction(int i, const string &name,
+void CUFixtureBase::TestFunction(int i, const string& name,
Module::Address address,
Module::Address size) {
FillFunctions();
ASSERT_LT((size_t) i, functions_.size());
- Module::Function *function = functions_[i];
+ Module::Function* function = functions_[i];
EXPECT_EQ(name, function->name);
EXPECT_EQ(address, function->address);
EXPECT_EQ(size, function->ranges[0].size);
@@ -611,12 +619,12 @@ void CUFixtureBase::TestLineCount(int i, size_t expected) {
void CUFixtureBase::TestLine(int i, int j,
Module::Address address, Module::Address size,
- const string &filename, int number) {
+ const string& filename, int number) {
FillFunctions();
ASSERT_LT((size_t) i, functions_.size());
ASSERT_LT((size_t) j, functions_[i]->lines.size());
- Module::Line *line = &functions_[i]->lines[j];
+ Module::Line* line = &functions_[i]->lines[j];
EXPECT_EQ(address, line->address);
EXPECT_EQ(size, line->size);
EXPECT_EQ(filename, line->file->name.c_str());
@@ -703,7 +711,7 @@ TEST_F(SimpleCU, IrrelevantRootChildren) {
TEST_F(SimpleCU, IrrelevantNamedScopeChildren) {
StartCU();
- DIEHandler *class_A_handler
+ DIEHandler* class_A_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type, "class_A");
EXPECT_TRUE(class_A_handler != NULL);
EXPECT_FALSE(class_A_handler
@@ -853,7 +861,7 @@ INSTANTIATE_TEST_CASE_P(AllSituations, FuncLinePairing,
ValuesIn(situations));
TEST_P(FuncLinePairing, Pairing) {
- const Situation &s = GetParam();
+ const Situation& s = GetParam();
PushLine(s.lines[0].start,
s.lines[0].end - s.lines[0].start,
"line-file", 67636963);
@@ -1049,7 +1057,7 @@ TEST_P(CXXQualifiedNames, TwoFunctions) {
PushLine(20, 1, "filename2", 95115701);
StartCU();
- DIEHandler *enclosure_handler = StartNamedDIE(&root_handler_, tag,
+ DIEHandler* enclosure_handler = StartNamedDIE(&root_handler_, tag,
"Enclosure");
EXPECT_TRUE(enclosure_handler != NULL);
DefineFunction(enclosure_handler, "func_B", 10, 1, NULL);
@@ -1070,11 +1078,11 @@ TEST_P(CXXQualifiedNames, FuncInEnclosureInNamespace) {
PushLine(10, 1, "line-file", 69819327);
StartCU();
- DIEHandler *namespace_handler
+ DIEHandler* namespace_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
"Namespace");
EXPECT_TRUE(namespace_handler != NULL);
- DIEHandler *enclosure_handler = StartNamedDIE(namespace_handler, tag,
+ DIEHandler* enclosure_handler = StartNamedDIE(namespace_handler, tag,
"Enclosure");
EXPECT_TRUE(enclosure_handler != NULL);
DefineFunction(enclosure_handler, "function", 10, 1, NULL);
@@ -1093,15 +1101,15 @@ TEST_F(CXXQualifiedNames, FunctionInClassInStructInNamespace) {
PushLine(10, 1, "filename1", 69819327);
StartCU();
- DIEHandler *namespace_handler
+ DIEHandler* namespace_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
"namespace_A");
EXPECT_TRUE(namespace_handler != NULL);
- DIEHandler *struct_handler
+ DIEHandler* struct_handler
= StartNamedDIE(namespace_handler, dwarf2reader::DW_TAG_structure_type,
"struct_B");
EXPECT_TRUE(struct_handler != NULL);
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartNamedDIE(struct_handler, dwarf2reader::DW_TAG_class_type,
"class_C");
DefineFunction(class_handler, "function_D", 10, 1, NULL);
@@ -1119,7 +1127,7 @@ TEST_F(CXXQualifiedNames, FunctionInClassInStructInNamespace) {
struct LanguageAndQualifiedName {
dwarf2reader::DwarfLanguage language;
- const char *name;
+ const char* name;
};
const LanguageAndQualifiedName LanguageAndQualifiedNameCases[] = {
@@ -1141,13 +1149,13 @@ INSTANTIATE_TEST_CASE_P(LanguageAndQualifiedName, QualifiedForLanguage,
ValuesIn(LanguageAndQualifiedNameCases));
TEST_P(QualifiedForLanguage, MemberFunction) {
- const LanguageAndQualifiedName &param = GetParam();
+ const LanguageAndQualifiedName& param = GetParam();
PushLine(10, 1, "line-file", 212966758);
SetLanguage(param.language);
StartCU();
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
"class_A");
DefineFunction(class_handler, "function_B", 10, 1, NULL);
@@ -1164,14 +1172,14 @@ TEST_P(QualifiedForLanguage, MemberFunction) {
}
TEST_P(QualifiedForLanguage, MemberFunctionSignedLanguage) {
- const LanguageAndQualifiedName &param = GetParam();
+ const LanguageAndQualifiedName& param = GetParam();
PushLine(10, 1, "line-file", 212966758);
SetLanguage(param.language);
SetLanguageSigned(true);
StartCU();
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
"class_A");
DefineFunction(class_handler, "function_B", 10, 1, NULL);
@@ -1274,7 +1282,7 @@ TEST_F(Specifications, MemberFunction) {
PushLine(0x3341a248634e7170ULL, 0x5f6938ee5553b953ULL, "line-file", 18116691);
StartCU();
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type, "class_A");
DeclarationDIE(class_handler, 0x7d83028c431406e8ULL,
dwarf2reader::DW_TAG_subprogram, "declaration-name", "");
@@ -1297,7 +1305,7 @@ TEST_F(Specifications, FunctionDeclarationParent) {
StartCU();
{
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
"class_A");
ASSERT_TRUE(class_handler != NULL);
@@ -1325,7 +1333,7 @@ TEST_F(Specifications, NamedScopeDeclarationParent) {
StartCU();
{
- DIEHandler *space_handler
+ DIEHandler* space_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
"space_A");
ASSERT_TRUE(space_handler != NULL);
@@ -1337,7 +1345,7 @@ TEST_F(Specifications, NamedScopeDeclarationParent) {
}
{
- DIEHandler *class_handler
+ DIEHandler* class_handler
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
0x419bb1d12f9a73a2ULL, "class-definition-name");
ASSERT_TRUE(class_handler != NULL);
@@ -1429,7 +1437,7 @@ TEST_F(Specifications, LongChain) {
// space_A::space_B::struct_C::struct_D::union_E::union_F::
// class_G::class_H::func_I
{
- DIEHandler *space_A_handler
+ DIEHandler* space_A_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
"space_A");
DeclarationDIE(space_A_handler, 0x2e111126496596e2ULL,
@@ -1439,10 +1447,10 @@ TEST_F(Specifications, LongChain) {
}
{
- DIEHandler *space_B_handler
+ DIEHandler* space_B_handler
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
0x2e111126496596e2ULL);
- DIEHandler *struct_C_handler
+ DIEHandler* struct_C_handler
= StartNamedDIE(space_B_handler, dwarf2reader::DW_TAG_structure_type,
"struct_C");
DeclarationDIE(struct_C_handler, 0x20cd423bf2a25a4cULL,
@@ -1454,10 +1462,10 @@ TEST_F(Specifications, LongChain) {
}
{
- DIEHandler *struct_D_handler
+ DIEHandler* struct_D_handler
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_structure_type,
0x20cd423bf2a25a4cULL);
- DIEHandler *union_E_handler
+ DIEHandler* union_E_handler
= StartNamedDIE(struct_D_handler, dwarf2reader::DW_TAG_union_type,
"union_E");
DeclarationDIE(union_E_handler, 0xe25c84805aa58c32ULL,
@@ -1469,10 +1477,10 @@ TEST_F(Specifications, LongChain) {
}
{
- DIEHandler *union_F_handler
+ DIEHandler* union_F_handler
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_union_type,
0xe25c84805aa58c32ULL);
- DIEHandler *class_G_handler
+ DIEHandler* class_G_handler
= StartNamedDIE(union_F_handler, dwarf2reader::DW_TAG_class_type,
"class_G");
DeclarationDIE(class_G_handler, 0xb70d960dcc173b6eULL,
@@ -1484,7 +1492,7 @@ TEST_F(Specifications, LongChain) {
}
{
- DIEHandler *class_H_handler
+ DIEHandler* class_H_handler
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
0xb70d960dcc173b6eULL);
DeclarationDIE(class_H_handler, 0x27ff829e3bf69f37ULL,
@@ -1509,7 +1517,7 @@ TEST_F(Specifications, InterCU) {
DwarfCUToModule::FileContext fc("dwarf-filename", &m, true);
EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
MockLineToModuleHandler lr;
- EXPECT_CALL(lr, ReadProgram(_,_,_,_)).Times(0);
+ EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0);
// Kludge: satisfy reporter_'s expectation.
reporter_.SetCUName("compilation-unit-name");
@@ -1534,7 +1542,7 @@ TEST_F(Specifications, InterCU) {
ASSERT_TRUE(root2_handler.StartRootDIE(1,
dwarf2reader::DW_TAG_compile_unit));
ASSERT_TRUE(root2_handler.EndAttributes());
- DIEHandler *class_A_handler
+ DIEHandler* class_A_handler
= StartSpecifiedDIE(&root2_handler, dwarf2reader::DW_TAG_class_type,
0xb8fbfdd5f0b26fceULL);
DeclarationDIE(class_A_handler, 0xb01fef8b380bd1a2ULL,
@@ -1557,7 +1565,7 @@ TEST_F(Specifications, InterCU) {
root3_handler.Finish();
}
- vector<Module::Function *> functions;
+ vector<Module::Function*> functions;
m.GetFunctions(&functions, functions.end());
EXPECT_EQ(1U, functions.size());
EXPECT_STREQ("class_A::member_func_B", functions[0]->name.c_str());
@@ -1568,7 +1576,7 @@ TEST_F(Specifications, UnhandledInterCU) {
DwarfCUToModule::FileContext fc("dwarf-filename", &m, false);
EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
MockLineToModuleHandler lr;
- EXPECT_CALL(lr, ReadProgram(_,_,_,_)).Times(0);
+ EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0);
// Kludge: satisfy reporter_'s expectation.
reporter_.SetCUName("compilation-unit-name");
@@ -1594,7 +1602,7 @@ TEST_F(Specifications, UnhandledInterCU) {
dwarf2reader::DW_TAG_compile_unit));
ASSERT_TRUE(root2_handler.EndAttributes());
EXPECT_CALL(reporter_, UnhandledInterCUReference(_, _)).Times(1);
- DIEHandler *class_A_handler
+ DIEHandler* class_A_handler
= StartSpecifiedDIE(&root2_handler, dwarf2reader::DW_TAG_class_type,
0xb8fbfdd5f0b26fceULL);
DeclarationDIE(class_A_handler, 0xb01fef8b380bd1a2ULL,
@@ -1657,7 +1665,7 @@ TEST_F(Specifications, ClassDefinitionHasOwnName) {
DeclarationDIE(&root_handler_, 0xd0fe467ec2f1a58cULL,
dwarf2reader::DW_TAG_class_type, "class-declaration-name", "");
- dwarf2reader::DIEHandler *class_definition
+ dwarf2reader::DIEHandler* class_definition
= StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
0xd0fe467ec2f1a58cULL, "class-definition-name");
ASSERT_TRUE(class_definition);
@@ -1688,7 +1696,7 @@ TEST_F(Specifications, PreferSpecificationParents) {
StartCU();
{
- dwarf2reader::DIEHandler *declaration_class_handler =
+ dwarf2reader::DIEHandler* declaration_class_handler =
StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
"declaration-class");
DeclarationDIE(declaration_class_handler, 0x9ddb35517455ef7aULL,
@@ -1698,7 +1706,7 @@ TEST_F(Specifications, PreferSpecificationParents) {
delete declaration_class_handler;
}
{
- dwarf2reader::DIEHandler *definition_class_handler
+ dwarf2reader::DIEHandler* definition_class_handler
= StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
"definition-class");
DefinitionDIE(definition_class_handler, dwarf2reader::DW_TAG_subprogram,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.cc
index 443d74489db..fe808c0865e 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.cc
@@ -44,18 +44,18 @@
// it until we actually have to deal with DWARF on Windows.
// Return true if PATH is an absolute path, false if it is relative.
-static bool PathIsAbsolute(const string &path) {
+static bool PathIsAbsolute(const string& path) {
return (path.size() >= 1 && path[0] == '/');
}
-static bool HasTrailingSlash(const string &path) {
+static bool HasTrailingSlash(const string& path) {
return (path.size() >= 1 && path[path.size() - 1] == '/');
}
// If PATH is an absolute path, return PATH. If PATH is a relative path,
// treat it as relative to BASE and return the combined path.
-static string ExpandPath(const string &path,
- const string &base) {
+static string ExpandPath(const string& path,
+ const string& base) {
if (PathIsAbsolute(path) || base.empty())
return path;
return base + (HasTrailingSlash(base) ? "" : "/") + path;
@@ -63,14 +63,14 @@ static string ExpandPath(const string &path,
namespace google_breakpad {
-void DwarfLineToModule::DefineDir(const string &name, uint32_t 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_t file_num,
+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)
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.h
index f54ccaf5f40..f80f1b07045 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module.h
@@ -121,7 +121,7 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
// sort out which lines belong to which functions; we don't add them
// to any particular function in MODULE ourselves.
DwarfLineToModule(Module *module, const string& compilation_dir,
- vector<Module::Line> *lines)
+ vector<Module::Line>* lines)
: module_(module),
compilation_dir_(compilation_dir),
lines_(lines),
@@ -132,8 +132,8 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
~DwarfLineToModule() { }
- void DefineDir(const string &name, uint32_t dir_num);
- void DefineFile(const string &name, int32_t file_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,
@@ -142,7 +142,7 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
private:
typedef std::map<uint32_t, string> DirectoryTable;
- typedef std::map<uint32_t, Module::File *> FileTable;
+ typedef std::map<uint32_t, Module::File*> FileTable;
// The module we're contributing debugging info to. Owned by our
// client.
@@ -161,7 +161,7 @@ class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
// to the appropriate function from module_ until we've read the
// function info as well. Instead, we accumulate lines here, and let
// whoever constructed this sort it all out.
- vector<Module::Line> *lines_;
+ vector<Module::Line>* lines_;
// A table mapping directory numbers to paths.
DirectoryTable directories_;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module_unittest.cc
index 7c0fcfd35a6..90b6570d8dd 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_line_to_module_unittest.cc
@@ -51,7 +51,7 @@ TEST(SimpleModule, One) {
h.AddLine(0x6fd126fbf74f2680LL, 0x63c9a14cf556712bLL, 0x30bf0f27,
0x4c090cbf, 0x1cf9fe0d);
- vector<Module::File *> files;
+ vector<Module::File*> files;
m.GetFiles(&files);
EXPECT_EQ(1U, files.size());
EXPECT_STREQ("/file1", files[0]->name.c_str());
@@ -86,7 +86,7 @@ TEST(SimpleModule, Many) {
h.AddLine(0xe2d72a37f8d9403aULL, 0x034dfab5b0d4d236ULL, 0x63beb4a5,
0x75047044U, 0xb6a0016cU);
- vector<Module::File *> files;
+ vector<Module::File*> files;
m.GetFiles(&files);
ASSERT_EQ(5U, files.size());
EXPECT_STREQ("/directory1/file1", files[0]->name.c_str());
@@ -133,7 +133,7 @@ TEST(Filenames, Absolute) {
h.AddLine(1, 1, 1, 0, 0);
- vector<Module::File *> files;
+ vector<Module::File*> files;
m.GetFiles(&files);
ASSERT_EQ(1U, files.size());
EXPECT_STREQ("/absolute", files[0]->name.c_str());
@@ -151,7 +151,7 @@ TEST(Filenames, Relative) {
h.AddLine(1, 1, 1, 0, 0);
- vector<Module::File *> files;
+ vector<Module::File*> files;
m.GetFiles(&files);
ASSERT_EQ(1U, files.size());
EXPECT_STREQ("/directory1/relative", files[0]->name.c_str());
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.cc
index cc9e39ce8d4..58982aacc84 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.cc
@@ -51,7 +51,7 @@ void DwarfRangeListHandler::SetBaseAddress(uint64_t base_address) {
void DwarfRangeListHandler::Finish() {
std::sort(ranges_->begin(), ranges_->end(),
- [](const Module::Range &a, const Module::Range &b) {
+ [](const Module::Range& a, const Module::Range& b) {
return a.address < b.address;
}
);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.h b/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.h
index 83a3469486f..2adb2f9af4f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf_range_list_handler.h
@@ -51,7 +51,7 @@ namespace google_breakpad {
class DwarfRangeListHandler: public dwarf2reader::RangeListHandler {
public:
- DwarfRangeListHandler(uint64_t base_address, vector<Module::Range> *ranges)
+ DwarfRangeListHandler(uint64_t base_address, vector<Module::Range>* ranges)
: base_address_(base_address), ranges_(ranges) { }
~DwarfRangeListHandler() { }
@@ -71,7 +71,7 @@ class DwarfRangeListHandler: public dwarf2reader::RangeListHandler {
uint64_t base_address_;
// The list of ranges to be populated
- vector<Module::Range> *ranges_;
+ vector<Module::Range>* ranges_;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/common/language.cc b/chromium/third_party/breakpad/breakpad/src/common/language.cc
index d26e5638202..381c8bd4fb5 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/language.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/language.cc
@@ -67,8 +67,8 @@ class CPPLanguage: public Language {
public:
CPPLanguage() {}
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
+ string MakeQualifiedName(const string& parent_name,
+ const string& name) const {
return MakeQualifiedNameWithSeparator(parent_name, "::", name);
}
@@ -79,17 +79,12 @@ class CPPLanguage: public Language {
demangled->clear();
return kDontDemangle;
#else
-#if defined(__APPLE__)
- // Mac C++ symbols can have up to 4 underscores, followed by a "Z".
- // Non-C++ symbols are not coded that way, but may have leading underscores.
// Attempting to demangle non-C++ symbols with the C++ demangler would print
// warnings and fail, so return kDontDemangle for these.
- size_t i = mangled.find_first_not_of('_');
- if (i == 0 || i == string::npos || i > 4 || mangled[i] != 'Z') {
+ if (!IsMangledName(mangled)) {
demangled->clear();
return kDontDemangle;
}
-#endif
int status;
char* demangled_c =
@@ -111,6 +106,21 @@ class CPPLanguage: public Language {
return result;
#endif
}
+
+ private:
+ static bool IsMangledName(const string& name) {
+ // NOTE: For proper cross-compilation support, this should depend on target
+ // binary's platform, not current build platform.
+#if defined(__APPLE__)
+ // Mac C++ symbols can have up to 4 underscores, followed by a "Z".
+ // Non-C++ symbols are not coded that way, but may have leading underscores.
+ size_t i = name.find_first_not_of('_');
+ return i > 0 && i != string::npos && i <= 4 && name[i] == 'Z';
+#else
+ // Linux C++ symbols always start with "_Z".
+ return name.size() > 2 && name[0] == '_' && name[1] == 'Z';
+#endif
+ }
};
CPPLanguage CPPLanguageSingleton;
@@ -120,8 +130,8 @@ class JavaLanguage: public Language {
public:
JavaLanguage() {}
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
+ string MakeQualifiedName(const string& parent_name,
+ const string& name) const {
return MakeQualifiedNameWithSeparator(parent_name, ".", name);
}
};
@@ -133,8 +143,8 @@ class SwiftLanguage: public Language {
public:
SwiftLanguage() {}
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
+ string MakeQualifiedName(const string& parent_name,
+ const string& name) const {
return MakeQualifiedNameWithSeparator(parent_name, ".", name);
}
@@ -157,8 +167,8 @@ class RustLanguage: public Language {
public:
RustLanguage() {}
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
+ string MakeQualifiedName(const string& parent_name,
+ const string& name) const {
return MakeQualifiedNameWithSeparator(parent_name, ".", name);
}
@@ -192,8 +202,8 @@ class AssemblerLanguage: public Language {
AssemblerLanguage() {}
bool HasFunctions() const { return false; }
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
+ string MakeQualifiedName(const string& parent_name,
+ const string& name) const {
return name;
}
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/language.h b/chromium/third_party/breakpad/breakpad/src/common/language.h
index 2d2dbcd9e92..892ea862e4e 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/language.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/language.h
@@ -74,8 +74,8 @@ class Language {
// take into account the parent and child DIE types, allow languages
// to use their own data type for complex parent names, etc. But if
// C++ doesn't need all that, who would?
- virtual string MakeQualifiedName (const string &parent_name,
- const string &name) const = 0;
+ 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.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/breakpad_getcontext.S b/chromium/third_party/breakpad/breakpad/src/common/linux/breakpad_getcontext.S
index fea0109d150..528dba7a97f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/breakpad_getcontext.S
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/breakpad_getcontext.S
@@ -32,7 +32,7 @@
#include "common/linux/ucontext_constants.h"
-/* int getcontext (ucontext_t *ucp) */
+/* int getcontext (ucontext_t* ucp) */
#if defined(__arm__)
@@ -336,7 +336,7 @@ symbol: .frame sp, framesize, rpc;
.size function,.-function
#endif
-/* int getcontext (ucontext_t *ucp) */
+/* int getcontext (ucontext_t* ucp) */
NESTED (breakpad_getcontext, FRAME_SIZE, ra)
.mask 0x10000000, 0
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.cc
index b7e77ab73fb..8ecf0bc4a23 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.cc
@@ -144,7 +144,7 @@ class MmapWrapper {
munmap(base_, size_);
}
}
- void set(void *mapped_address, size_t mapped_size) {
+ void set(void* mapped_address, size_t mapped_size) {
is_set_ = true;
base_ = mapped_address;
size_ = mapped_size;
@@ -232,7 +232,7 @@ bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
// owned by a function) with the results.
class DumperRangesHandler : public DwarfCUToModule::RangesHandler {
public:
- DumperRangesHandler(const uint8_t *buffer, uint64_t size,
+ DumperRangesHandler(const uint8_t* buffer, uint64_t size,
dwarf2reader::ByteReader* reader)
: buffer_(buffer), size_(size), reader_(reader) { }
@@ -246,7 +246,7 @@ class DumperRangesHandler : public DwarfCUToModule::RangesHandler {
}
private:
- const uint8_t *buffer_;
+ const uint8_t* buffer_;
uint64_t size_;
dwarf2reader::ByteReader* reader_;
};
@@ -257,20 +257,28 @@ class DumperRangesHandler : public DwarfCUToModule::RangesHandler {
class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler {
public:
// Create a line-to-module converter using BYTE_READER.
- explicit DumperLineToModule(dwarf2reader::ByteReader *byte_reader)
+ explicit DumperLineToModule(dwarf2reader::ByteReader* byte_reader)
: byte_reader_(byte_reader) { }
void StartCompilationUnit(const string& compilation_dir) {
compilation_dir_ = compilation_dir;
}
- void ReadProgram(const uint8_t *program, uint64_t length,
+ void ReadProgram(const uint8_t* program, uint64_t length,
+ const uint8_t* string_section,
+ uint64_t string_section_length,
+ const uint8_t* line_string_section,
+ uint64_t line_string_section_length,
Module* module, std::vector<Module::Line>* lines) {
DwarfLineToModule handler(module, compilation_dir_, lines);
- dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
+ dwarf2reader::LineInfo parser(program, length, byte_reader_,
+ string_section, string_section_length,
+ line_string_section,
+ line_string_section_length,
+ &handler);
parser.Start();
}
private:
string compilation_dir_;
- dwarf2reader::ByteReader *byte_reader_;
+ dwarf2reader::ByteReader* byte_reader_;
};
template<typename ElfClass>
@@ -300,7 +308,7 @@ bool LoadDwarf(const string& dwarf_filename,
string name = GetOffset<ElfClass, char>(elf_header,
section_names->sh_offset) +
section->sh_name;
- const uint8_t *contents = GetOffset<ElfClass, uint8_t>(elf_header,
+ const uint8_t* contents = GetOffset<ElfClass, uint8_t>(elf_header,
section->sh_offset);
file_context.AddSectionToSectionMap(name, contents, section->sh_size);
}
@@ -310,7 +318,7 @@ bool LoadDwarf(const string& dwarf_filename,
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 =
+ const std::pair<const uint8_t*, uint64_t>& ranges_section =
ranges_entry->second;
ranges_handler.reset(
new DumperRangesHandler(ranges_section.first, ranges_section.second,
@@ -322,7 +330,7 @@ bool LoadDwarf(const string& dwarf_filename,
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 uint8_t *, uint64_t>& 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.
@@ -401,7 +409,7 @@ bool LoadDwarfCFI(const string& dwarf_filename,
dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE;
// Find the call frame information and its size.
- const uint8_t *cfi =
+ const uint8_t* cfi =
GetOffset<ElfClass, uint8_t>(elf_header, section->sh_offset);
size_t cfi_size = section->sh_size;
@@ -489,13 +497,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 uint8_t *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) {
// Include '\0' + CRC32 (4 bytes).
- size_t debuglink_len = strlen(reinterpret_cast<const char *>(debuglink)) + 5;
+ 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.
@@ -517,7 +525,7 @@ string ReadDebugLink(const uint8_t *debuglink,
for (it = debug_dirs.begin(); it < debug_dirs.end(); ++it) {
const string& debug_dir = *it;
debuglink_path = debug_dir + "/" +
- reinterpret_cast<const char *>(debuglink);
+ 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,
@@ -591,7 +599,7 @@ class LoadSymbolsInfo {
// Keeps track of which sections have been loaded so sections don't
// accidentally get loaded twice from two different files.
- void LoadedSection(const string &section) {
+ void LoadedSection(const string& section) {
if (loaded_sections_.count(section) == 0) {
loaded_sections_.insert(section);
} else {
@@ -602,7 +610,7 @@ class LoadSymbolsInfo {
// The ELF file and linked debug file are expected to have the same preferred
// loading address.
- void set_loading_addr(Addr addr, const string &filename) {
+ void set_loading_addr(Addr addr, const string& filename) {
if (!has_loading_addr_) {
loading_addr_ = addr;
loaded_file_ = filename;
@@ -679,7 +687,7 @@ bool LoadSymbols(const string& obj_file,
const Shdr* section_names = sections + elf_header->e_shstrndx;
const char* names =
GetOffset<ElfClass, char>(elf_header, section_names->sh_offset);
- const char *names_end = names + section_names->sh_size;
+ const char* names_end = names + section_names->sh_size;
bool found_debug_info_section = false;
bool found_usable_info = false;
@@ -859,7 +867,7 @@ bool LoadSymbols(const string& obj_file,
names_end, elf_header->e_shnum);
if (gnu_debuglink_section) {
if (!info->debug_dirs().empty()) {
- const uint8_t *debuglink_contents =
+ const uint8_t* debuglink_contents =
GetOffset<ElfClass, uint8_t>(elf_header,
gnu_debuglink_section->sh_offset);
string debuglink_file =
@@ -956,7 +964,7 @@ bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header,
return false;
}
- const char *architecture = ElfArchitecture<ElfClass>(elf_header);
+ const char* architecture = ElfArchitecture<ElfClass>(elf_header);
if (!architecture) {
fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n",
obj_filename.c_str(), elf_header->e_machine);
@@ -1066,12 +1074,12 @@ bool ReadSymbolDataInternal(const uint8_t* obj_file,
return false;
}
-bool WriteSymbolFile(const string &load_path,
- const string &obj_file,
- const string &obj_os,
+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) {
+ std::ostream& sym_stream) {
Module* module;
if (!ReadSymbolData(load_path, obj_file, obj_os, debug_dirs, options,
&module))
@@ -1088,7 +1096,7 @@ bool WriteSymbolFile(const string &load_path,
bool WriteSymbolFileHeader(const string& load_path,
const string& obj_file,
const string& obj_os,
- std::ostream &sym_stream) {
+ std::ostream& sym_stream) {
MmapWrapper map_wrapper;
void* elf_header = NULL;
if (!LoadELF(load_path, &map_wrapper, &elf_header)) {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.h b/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.h
index eaddd8b2ec8..b033ce00eaa 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/dump_symbols.h
@@ -62,12 +62,12 @@ 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 &load_path,
- const string &obj_file,
- const string &obj_os,
+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);
+ 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
@@ -76,7 +76,7 @@ bool WriteSymbolFile(const string &load_path,
bool WriteSymbolFileHeader(const string& load_path,
const string& obj_file,
const string& obj_os,
- std::ostream &sym_stream);
+ 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
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.cc
index 562875e11b5..81e985a7222 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.cc
@@ -69,7 +69,7 @@ public:
// otherwise. Assume each symbol has a 'value' field whose size is
// VALUE_SIZE.
//
- ELFSymbolIterator(const ByteBuffer *buffer, bool big_endian,
+ ELFSymbolIterator(const ByteBuffer* buffer, bool big_endian,
size_t value_size)
: value_size_(value_size), cursor_(buffer, big_endian) {
// Actually, weird sizes could be handled just fine, but they're
@@ -81,13 +81,13 @@ public:
// Move to the next symbol. This function's behavior is undefined if
// at_end() is true when it is called.
- ELFSymbolIterator &operator++() { Fetch(); symbol_.index++; return *this; }
+ ELFSymbolIterator& operator++() { Fetch(); symbol_.index++; return *this; }
// Dereferencing this iterator produces a reference to an Symbol structure
// that holds the current symbol's values. The symbol is owned by this
// SymbolIterator, and will be invalidated at the next call to operator++.
- const Symbol &operator*() const { return symbol_; }
- const Symbol *operator->() const { return &symbol_; }
+ const Symbol& operator*() const { return symbol_; }
+ const Symbol* operator->() const { return &symbol_; }
private:
// Read the symbol at cursor_, and set symbol_ appropriately.
@@ -126,21 +126,21 @@ private:
Symbol symbol_;
};
-const char *SymbolString(ptrdiff_t offset, ByteBuffer& strings) {
+const char* SymbolString(ptrdiff_t offset, ByteBuffer& strings) {
if (offset < 0 || (size_t) offset >= strings.Size()) {
// Return the null string.
offset = 0;
}
- return reinterpret_cast<const char *>(strings.start + offset);
+ return reinterpret_cast<const char*>(strings.start + offset);
}
-bool ELFSymbolsToModule(const uint8_t *symtab_section,
+bool ELFSymbolsToModule(const uint8_t* symtab_section,
size_t symtab_size,
- const uint8_t *string_section,
+ const uint8_t* string_section,
size_t string_size,
const bool big_endian,
size_t value_size,
- Module *module) {
+ Module* module) {
ByteBuffer symbols(symtab_section, symtab_size);
// Ensure that the string section is null-terminated.
if (string_section[string_size - 1] != '\0') {
@@ -156,7 +156,7 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
while(!iterator->at_end) {
if (ELF32_ST_TYPE(iterator->info) == STT_FUNC &&
iterator->shndx != SHN_UNDEF) {
- Module::Extern *ext = new Module::Extern(iterator->value);
+ Module::Extern* ext = new Module::Extern(iterator->value);
ext->name = SymbolString(iterator->name_offset, strings);
#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
int status = 0;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.h b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.h
index 2e7c097151c..861f725297c 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module.h
@@ -44,13 +44,13 @@ namespace google_breakpad {
class Module;
-bool ELFSymbolsToModule(const uint8_t *symtab_section,
+bool ELFSymbolsToModule(const uint8_t* symtab_section,
size_t symtab_size,
- const uint8_t *string_section,
+ const uint8_t* string_section,
size_t string_size,
const bool big_endian,
size_t value_size,
- Module *module);
+ Module* module);
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module_unittest.cc
index 8984449ab65..3f66589851e 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_symbols_to_module_unittest.cc
@@ -86,7 +86,7 @@ public:
// 4 or 8 (bytes)
size_t value_size;
- vector<Module::Extern *> externs;
+ vector<Module::Extern*> externs;
};
class ELFSymbolsToModuleTest32 : public ELFSymbolsToModuleTestFixture,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.cc
index 9532d5aded5..ce9e9c1cf11 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.cc
@@ -40,11 +40,11 @@ namespace google_breakpad {
namespace {
template<typename ElfClass>
-void FindElfClassSection(const char *elf_base,
- const char *section_name,
+void FindElfClassSection(const char* elf_base,
+ const char* section_name,
typename ElfClass::Word section_type,
- const void **section_start,
- size_t *section_size) {
+ const void** section_start,
+ size_t* section_size) {
typedef typename ElfClass::Ehdr Ehdr;
typedef typename ElfClass::Shdr Shdr;
@@ -62,7 +62,7 @@ void FindElfClassSection(const char *elf_base,
const Shdr* section_names = sections + elf_header->e_shstrndx;
const char* names =
GetOffset<ElfClass, char>(elf_header, section_names->sh_offset);
- const char *names_end = names + section_names->sh_size;
+ const char* names_end = names + section_names->sh_size;
const Shdr* section =
FindElfSectionByName<ElfClass>(section_name, section_type,
@@ -76,9 +76,9 @@ void FindElfClassSection(const char *elf_base,
}
template<typename ElfClass>
-void FindElfClassSegment(const char *elf_base,
+void FindElfClassSegment(const char* elf_base,
typename ElfClass::Word segment_type,
- wasteful_vector<ElfSegment> *segments) {
+ wasteful_vector<ElfSegment>* segments) {
typedef typename ElfClass::Ehdr Ehdr;
typedef typename ElfClass::Phdr Phdr;
@@ -117,11 +117,11 @@ int ElfClass(const void* elf_base) {
return elf_header->e_ident[EI_CLASS];
}
-bool FindElfSection(const void *elf_mapped_base,
- const char *section_name,
+bool FindElfSection(const void* elf_mapped_base,
+ const char* section_name,
uint32_t section_type,
- const void **section_start,
- size_t *section_size) {
+ const void** section_start,
+ size_t* section_size) {
assert(elf_mapped_base);
assert(section_start);
assert(section_size);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.h b/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.h
index aefb6cf5f8a..ec5872a4f39 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elfutils.h
@@ -86,11 +86,11 @@ int ElfClass(const void* elf_base);
// 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.
-bool FindElfSection(const void *elf_mapped_base,
- const char *section_name,
+bool FindElfSection(const void* elf_mapped_base,
+ const char* section_name,
uint32_t section_type,
- const void **section_start,
- size_t *section_size);
+ const void** section_start,
+ size_t* section_size);
// Internal helper method, exposed for convenience for callers
// that already have more info.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/file_id.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/file_id.cc
index 67921c4561a..9944af7aec2 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/file_id.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/file_id.cc
@@ -61,7 +61,7 @@ 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.
-static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
+static bool ElfClassBuildIDNoteIdentifier(const void* section, size_t length,
wasteful_vector<uint8_t>& identifier) {
static_assert(sizeof(ElfClass32::Nhdr) == sizeof(ElfClass64::Nhdr),
"Elf32_Nhdr and Elf64_Nhdr should be the same");
@@ -69,7 +69,7 @@ static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
const void* section_end = reinterpret_cast<const char*>(section) + length;
const Nhdr* note_header = reinterpret_cast<const Nhdr*>(section);
- while (reinterpret_cast<const void *>(note_header) < section_end) {
+ while (reinterpret_cast<const void*>(note_header) < section_end) {
if (note_header->n_type == NT_GNU_BUILD_ID)
break;
note_header = reinterpret_cast<const Nhdr*>(
@@ -77,7 +77,7 @@ static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
NOTE_PADDING(note_header->n_namesz) +
NOTE_PADDING(note_header->n_descsz));
}
- if (reinterpret_cast<const void *>(note_header) >= section_end ||
+ if (reinterpret_cast<const void*>(note_header) >= section_end ||
note_header->n_descsz == 0) {
return false;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/file_id_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/file_id_unittest.cc
index f4f9ac45ce5..477783d9fae 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/file_id_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/file_id_unittest.cc
@@ -261,7 +261,7 @@ TYPED_TEST(FileIDTest, BuildIDPH) {
elf.AddSection(".text", text, SHT_PROGBITS);
Notes notes(kLittleEndian);
notes.AddNote(0, "Linux",
- reinterpret_cast<const uint8_t *>("\0x42\0x02\0\0"), 4);
+ reinterpret_cast<const uint8_t*>("\0x42\0x02\0\0"), 4);
notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
sizeof(kExpectedIdentifierBytes));
int note_idx = elf.AddSection(".note", notes, SHT_NOTE);
@@ -292,7 +292,7 @@ TYPED_TEST(FileIDTest, BuildIDMultiplePH) {
elf.AddSection(".text", text, SHT_PROGBITS);
Notes notes1(kLittleEndian);
notes1.AddNote(0, "Linux",
- reinterpret_cast<const uint8_t *>("\0x42\0x02\0\0"), 4);
+ reinterpret_cast<const uint8_t*>("\0x42\0x02\0\0"), 4);
Notes notes2(kLittleEndian);
notes2.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
sizeof(kExpectedIdentifierBytes));
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/guid_creator.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/guid_creator.cc
index 03e3d781fb0..6374063825b 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/guid_creator.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/guid_creator.cc
@@ -105,7 +105,7 @@ class GUIDGenerator {
private:
#ifdef HAVE_ARC4RANDOM
static void CreateGuidFromArc4Random(GUID *guid) {
- char *buf = reinterpret_cast<char *>(guid);
+ char *buf = reinterpret_cast<char*>(guid);
for (size_t i = 0; i < sizeof(GUID); i += sizeof(uint32_t)) {
uint32_t random_data = arc4random();
@@ -129,7 +129,7 @@ class GUIDGenerator {
#if defined(HAVE_SYS_RANDOM_H) && defined(HAVE_GETRANDOM)
static bool CreateGUIDFromGetrandom(GUID *guid) {
- char *buf = reinterpret_cast<char *>(guid);
+ char *buf = reinterpret_cast<char*>(guid);
int read_bytes = getrandom(buf, sizeof(GUID), GRND_NONBLOCK);
return (read_bytes == static_cast<int>(sizeof(GUID)));
@@ -139,7 +139,7 @@ class GUIDGenerator {
// 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);
+ char *buf = reinterpret_cast<char*>(guid);
int fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
if (fd == -1) {
@@ -154,7 +154,7 @@ class GUIDGenerator {
// Populate the GUID using a stream of random bytes obtained from rand().
static void CreateGUIDFromRand(GUID *guid) {
- char *buf = reinterpret_cast<char *>(guid);
+ char *buf = reinterpret_cast<char*>(guid);
InitOnce();
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.cc
index 702526af753..ace12b84e19 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.cc
@@ -36,14 +36,14 @@
namespace {
// Callback to get the response data from server.
-static size_t WriteCallback(void *ptr, size_t size,
- size_t nmemb, void *userp) {
+static size_t WriteCallback(void* ptr, size_t size,
+ size_t nmemb, void* userp) {
if (!userp)
return 0;
- string *response = reinterpret_cast<string *>(userp);
+ string* response = reinterpret_cast<string*>(userp);
size_t real_size = size * nmemb;
- response->append(reinterpret_cast<char *>(ptr), real_size);
+ response->append(reinterpret_cast<char*>(ptr), real_size);
return real_size;
}
@@ -54,15 +54,15 @@ namespace google_breakpad {
static const char kUserAgent[] = "Breakpad/1.0 (Linux)";
// static
-bool HTTPUpload::SendRequest(const string &url,
- const map<string, string> &parameters,
- const map<string, string> &files,
- const string &proxy,
- const string &proxy_user_pwd,
- const string &ca_certificate_file,
- string *response_body,
- long *response_code,
- string *error_description) {
+bool HTTPUpload::SendRequest(const string& url,
+ const map<string, string>& parameters,
+ const map<string, string>& files,
+ const string& proxy,
+ const string& proxy_user_pwd,
+ const string& ca_certificate_file,
+ string* response_body,
+ long* response_code,
+ string* error_description) {
if (response_code != NULL)
*response_code = 0;
@@ -101,7 +101,7 @@ bool HTTPUpload::SendRequest(const string &url,
CURL* (*curl_easy_init)(void);
*(void**) (&curl_easy_init) = dlsym(curl_lib, "curl_easy_init");
- CURL *curl = (*curl_easy_init)();
+ CURL* curl = (*curl_easy_init)();
if (error_description != NULL)
*error_description = "No Error";
@@ -111,7 +111,7 @@ bool HTTPUpload::SendRequest(const string &url,
}
CURLcode err_code = CURLE_OK;
- CURLcode (*curl_easy_setopt)(CURL *, CURLoption, ...);
+ CURLcode (*curl_easy_setopt)(CURL*, CURLoption, ...);
*(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);
@@ -128,10 +128,10 @@ bool HTTPUpload::SendRequest(const string &url,
if (!ca_certificate_file.empty())
(*curl_easy_setopt)(curl, CURLOPT_CAINFO, ca_certificate_file.c_str());
- struct curl_httppost *formpost = NULL;
- struct curl_httppost *lastptr = NULL;
+ struct curl_httppost* formpost = NULL;
+ struct curl_httppost* lastptr = NULL;
// Add form data.
- CURLFORMcode (*curl_formadd)(struct curl_httppost **, struct curl_httppost **, ...);
+ CURLFORMcode (*curl_formadd)(struct curl_httppost**, struct curl_httppost**, ...);
*(void**) (&curl_formadd) = dlsym(curl_lib, "curl_formadd");
map<string, string>::const_iterator iter = parameters.begin();
for (; iter != parameters.end(); ++iter)
@@ -151,9 +151,9 @@ bool HTTPUpload::SendRequest(const string &url,
(*curl_easy_setopt)(curl, CURLOPT_HTTPPOST, formpost);
// Disable 100-continue header.
- struct curl_slist *headerlist = NULL;
+ struct curl_slist* headerlist = NULL;
char buf[] = "Expect:";
- struct curl_slist* (*curl_slist_append)(struct curl_slist *, const char *);
+ struct curl_slist* (*curl_slist_append)(struct curl_slist*, const char*);
*(void**) (&curl_slist_append) = dlsym(curl_lib, "curl_slist_append");
headerlist = (*curl_slist_append)(headerlist, buf);
(*curl_easy_setopt)(curl, CURLOPT_HTTPHEADER, headerlist);
@@ -161,17 +161,17 @@ bool HTTPUpload::SendRequest(const string &url,
if (response_body != NULL) {
(*curl_easy_setopt)(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
(*curl_easy_setopt)(curl, CURLOPT_WRITEDATA,
- reinterpret_cast<void *>(response_body));
+ reinterpret_cast<void*>(response_body));
}
// Fail if 400+ is returned from the web server.
(*curl_easy_setopt)(curl, CURLOPT_FAILONERROR, 1);
- CURLcode (*curl_easy_perform)(CURL *);
+ CURLcode (*curl_easy_perform)(CURL*);
*(void**) (&curl_easy_perform) = dlsym(curl_lib, "curl_easy_perform");
err_code = (*curl_easy_perform)(curl);
if (response_code != NULL) {
- CURLcode (*curl_easy_getinfo)(CURL *, CURLINFO, ...);
+ CURLcode (*curl_easy_getinfo)(CURL*, CURLINFO, ...);
*(void**) (&curl_easy_getinfo) = dlsym(curl_lib, "curl_easy_getinfo");
(*curl_easy_getinfo)(curl, CURLINFO_RESPONSE_CODE, response_code);
}
@@ -186,16 +186,16 @@ bool HTTPUpload::SendRequest(const string &url,
if (error_description != NULL)
*error_description = (*curl_easy_strerror)(err_code);
- void (*curl_easy_cleanup)(CURL *);
+ void (*curl_easy_cleanup)(CURL*);
*(void**) (&curl_easy_cleanup) = dlsym(curl_lib, "curl_easy_cleanup");
(*curl_easy_cleanup)(curl);
if (formpost != NULL) {
- void (*curl_formfree)(struct curl_httppost *);
+ void (*curl_formfree)(struct curl_httppost*);
*(void**) (&curl_formfree) = dlsym(curl_lib, "curl_formfree");
(*curl_formfree)(formpost);
}
if (headerlist != NULL) {
- void (*curl_slist_free_all)(struct curl_slist *);
+ void (*curl_slist_free_all)(struct curl_slist*);
*(void**) (&curl_slist_free_all) = dlsym(curl_lib, "curl_slist_free_all");
(*curl_slist_free_all)(headerlist);
}
@@ -211,10 +211,10 @@ bool HTTPUpload::CheckCurlLib(void* curl_lib) {
}
// static
-bool HTTPUpload::CheckParameters(const map<string, string> &parameters) {
+bool HTTPUpload::CheckParameters(const map<string, string>& parameters) {
for (map<string, string>::const_iterator pos = parameters.begin();
pos != parameters.end(); ++pos) {
- const string &str = pos->first;
+ const string& str = pos->first;
if (str.size() == 0)
return false; // disallow empty parameter names
for (unsigned int i = 0; i < str.size(); ++i) {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.h b/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.h
index bc1d5d5700b..13f3d56cc8d 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/http_upload.h
@@ -58,21 +58,21 @@ class HTTPUpload {
// received (or 0 if the request failed before getting an HTTP response).
// If the send fails, a description of the error will be
// returned in error_description.
- static bool SendRequest(const string &url,
- const map<string, string> &parameters,
- const map<string, string> &files,
- const string &proxy,
- const string &proxy_user_pwd,
- const string &ca_certificate_file,
- string *response_body,
- long *response_code,
- string *error_description);
+ static bool SendRequest(const string& url,
+ const map<string, string>& parameters,
+ const map<string, string>& files,
+ const string& proxy,
+ const string& proxy_user_pwd,
+ const string& ca_certificate_file,
+ string* response_body,
+ long* response_code,
+ string* error_description);
private:
// 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<string, string> &parameters);
+ 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);
@@ -80,8 +80,8 @@ class HTTPUpload {
// No instances of this class should be created.
// Disallow all constructors, destructors, and operator=.
HTTPUpload();
- explicit HTTPUpload(const HTTPUpload &);
- void operator=(const HTTPUpload &);
+ explicit HTTPUpload(const HTTPUpload&);
+ void operator=(const HTTPUpload&);
~HTTPUpload();
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.cc
index e96c2038521..fdb200f8e32 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.cc
@@ -88,14 +88,14 @@ bool LibcurlWrapper::AddFile(const string& upload_file_path,
}
// Callback to get the response data from server.
-static size_t WriteCallback(void *ptr, size_t size,
- size_t nmemb, void *userp) {
+static size_t WriteCallback(void* ptr, size_t size,
+ size_t nmemb, void* userp) {
if (!userp)
return 0;
- string *response = reinterpret_cast<string *>(userp);
+ string* response = reinterpret_cast<string*>(userp);
size_t real_size = size * nmemb;
- response->append(reinterpret_cast<char *>(ptr), real_size);
+ response->append(reinterpret_cast<char*>(ptr), real_size);
return real_size;
}
@@ -250,7 +250,7 @@ bool LibcurlWrapper::SetFunctionPointers() {
SET_AND_CHECK_FUNCTION_POINTER(easy_getinfo_,
"curl_easy_getinfo",
- CURLcode(*)(CURL *, CURLINFO info, ...));
+ CURLcode(*)(CURL*, CURLINFO info, ...));
SET_AND_CHECK_FUNCTION_POINTER(easy_reset_,
"curl_easy_reset",
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h b/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h
index 77aa6cbb725..823f83c7eed 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h
@@ -91,27 +91,27 @@ class LibcurlWrapper {
// dealing
// with CURL.
- CURL *curl_; // Pointer for handle for CURL calls.
+ CURL* curl_; // Pointer for handle for CURL calls.
CURL* (*easy_init_)(void);
// Stateful pointers for calling into curl_formadd()
- struct curl_httppost *formpost_;
- struct curl_httppost *lastptr_;
- struct curl_slist *headerlist_;
+ struct curl_httppost* formpost_;
+ struct curl_httppost* lastptr_;
+ struct curl_slist* headerlist_;
// Function pointers into CURL library
- CURLcode (*easy_setopt_)(CURL *, CURLoption, ...);
- CURLFORMcode (*formadd_)(struct curl_httppost **,
- struct curl_httppost **, ...);
- struct curl_slist* (*slist_append_)(struct curl_slist *, const char *);
- void (*slist_free_all_)(struct curl_slist *);
- CURLcode (*easy_perform_)(CURL *);
+ CURLcode (*easy_setopt_)(CURL*, CURLoption, ...);
+ CURLFORMcode (*formadd_)(struct curl_httppost**,
+ struct curl_httppost**, ...);
+ struct curl_slist* (*slist_append_)(struct curl_slist*, const char*);
+ void (*slist_free_all_)(struct curl_slist*);
+ CURLcode (*easy_perform_)(CURL*);
const char* (*easy_strerror_)(CURLcode);
- void (*easy_cleanup_)(CURL *);
- CURLcode (*easy_getinfo_)(CURL *, CURLINFO info, ...);
+ void (*easy_cleanup_)(CURL*);
+ CURLcode (*easy_getinfo_)(CURL*, CURLINFO info, ...);
void (*easy_reset_)(CURL*);
- void (*formfree_)(struct curl_httppost *);
+ void (*formfree_)(struct curl_httppost*);
};
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/linux_libc_support.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/linux_libc_support.cc
index 08b0325e6d9..dd292962621 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/linux_libc_support.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/linux_libc_support.cc
@@ -190,7 +190,7 @@ const char* my_read_decimal_ptr(uintptr_t* result, const char* s) {
}
void my_memset(void* ip, char c, size_t len) {
- char* p = (char *) ip;
+ char* p = (char*) ip;
while (len--)
*p++ = c;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/symbol_upload.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/symbol_upload.cc
index 87741a0a21d..1d5ff719652 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/symbol_upload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/symbol_upload.cc
@@ -46,8 +46,8 @@
namespace google_breakpad {
namespace sym_upload {
-void TokenizeByChar(const string &source_string, int c,
- std::vector<string> *results) {
+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) {
@@ -62,8 +62,8 @@ void TokenizeByChar(const string &source_string, int c,
//=============================================================================
// 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) {
+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");
@@ -90,7 +90,7 @@ bool ModuleDataForSymbolFile(const string &file,
}
//=============================================================================
-string CompactIdentifier(const string &uuid) {
+string CompactIdentifier(const string& uuid) {
std::vector<string> components;
TokenizeByChar(uuid, '-', &components);
string result;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.cc
index 98e81dab752..2ba25e6115a 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.cc
@@ -118,7 +118,7 @@ int ELF::AddSection(const string& name, const Section& section,
return index;
}
-void ELF::AppendSection(ElfSection &section) {
+void ELF::AppendSection(ElfSection& section) {
// NULL and NOBITS sections have no content, so they
// don't need to be written to the file.
if (section.type_ == SHT_NULL) {
@@ -242,7 +242,7 @@ void SymbolTable::AddSymbol(const string& name, uint64_t value,
D64(size);
}
-void Notes::AddNote(int type, const string &name, const uint8_t* desc_bytes,
+void Notes::AddNote(int type, const string& name, const uint8_t* desc_bytes,
size_t desc_size) {
// Elf32_Nhdr and Elf64_Nhdr are exactly the same.
Elf32_Nhdr note_header;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.h b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.h
index 1d2a20ca22b..90fa28c0dce 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf.h
@@ -154,7 +154,7 @@ class ELF : public Section {
vector<ElfSection> sections_;
- void AppendSection(ElfSection &section);
+ void AppendSection(ElfSection& section);
};
// A class to build .symtab or .dynsym sections.
@@ -187,7 +187,7 @@ public:
}
// Add a note.
- void AddNote(int type, const string &name, const uint8_t* desc_bytes,
+ void AddNote(int type, const string& name, const uint8_t* desc_bytes,
size_t desc_size);
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf_unittest.cc
index cd74c286242..fb3601e659f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/synth_elf_unittest.cc
@@ -381,9 +381,9 @@ TEST_F(ElfNotesTest, Empty) {
TEST_F(ElfNotesTest, Notes) {
Notes notes(kLittleEndian);
- notes.AddNote(1, "Linux", reinterpret_cast<const uint8_t *>("\x42\x02\0\0"),
+ notes.AddNote(1, "Linux", reinterpret_cast<const uint8_t*>("\x42\x02\0\0"),
4);
- notes.AddNote(2, "a", reinterpret_cast<const uint8_t *>("foobar"),
+ notes.AddNote(2, "a", reinterpret_cast<const uint8_t*>("foobar"),
sizeof("foobar") - 1);
const uint8_t kExpectedNotesContents[] = {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.h b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.h
new file mode 100644
index 00000000000..3aa316b544b
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2020, 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.
+
+#import <Foundation/Foundation.h>
+
+#import "HTTPRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Represents a HTTP GET request
+ */
+@interface HTTPGetRequest : HTTPRequest
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.m b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.m
new file mode 100644
index 00000000000..f9b7bf0ece6
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPGetRequest.m
@@ -0,0 +1,39 @@
+// Copyright (c) 2020, 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.
+
+#import "HTTPGetRequest.h"
+
+@implementation HTTPGetRequest
+
+//=============================================================================
+- (NSString*)HTTPMethod {
+ return @"GET";
+}
+
+@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.h b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.h
index 42e8fed3908..56d5394dbe9 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.h
@@ -27,35 +27,37 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// HTTPMultipartUpload: A multipart/form-data HTTP uploader.
-// Each parameter pair is sent as a boundary
-// Each file is sent with a name field in addition to the filename and data
-// The data will be sent synchronously.
-
#import <Foundation/Foundation.h>
-@interface HTTPMultipartUpload : NSObject {
+#import "HTTPRequest.h"
+/**
+ Represents a multipart/form-data HTTP upload (POST request).
+ Each parameter pair is sent as a boundary.
+ Each file is sent with a name field in addition to the filename and data.
+ */
+@interface HTTPMultipartUpload : HTTPRequest {
@protected
- NSURL *url_; // The destination URL (STRONG)
- NSDictionary *parameters_; // The key/value pairs for sending data (STRONG)
- NSMutableDictionary *files_; // Dictionary of name/file-path (STRONG)
- NSString *boundary_; // The boundary string (STRONG)
- NSHTTPURLResponse *response_; // The response from the send (STRONG)
+ NSDictionary* parameters_; // The key/value pairs for sending data (STRONG)
+ NSMutableDictionary* files_; // Dictionary of name/file-path (STRONG)
+ NSString* boundary_; // The boundary string (STRONG)
}
-- (id)initWithURL:(NSURL *)url;
-
-- (NSURL *)URL;
-
-- (void)setParameters:(NSDictionary *)parameters;
-- (NSDictionary *)parameters;
-
-- (void)addFileAtPath:(NSString *)path name:(NSString *)name;
-- (void)addFileContents:(NSData *)data name:(NSString *)name;
-- (NSDictionary *)files;
-
-// Set the data and return the response
-- (NSData *)send:(NSError **)error;
-- (NSHTTPURLResponse *)response;
+/**
+ Sets the parameters that will be sent in the multipart POST request.
+ */
+- (void)setParameters:(NSDictionary*)parameters;
+- (NSDictionary*)parameters;
+
+/**
+ Adds a file to be uploaded in the multipart POST request, by its file path.
+ */
+- (void)addFileAtPath:(NSString*)path name:(NSString*)name;
+
+/**
+ Adds a file to be uploaded in the multipart POST request, by its name and
+ contents.
+ */
+- (void)addFileContents:(NSData*)data name:(NSString*)name;
+- (NSDictionary*)files;
@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.m b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.m
index a3677f25c96..2aa64f7913c 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.m
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPMultipartUpload.m
@@ -28,74 +28,17 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#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
-}
+#import "GTMDefines.h"
+#import "encoding_util.h"
-// 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;
+@interface HTTPMultipartUpload (PrivateMethods)
+- (NSString*)multipartBoundary;
// Each of the following methods will append the starting multipart boundary,
// but not the ending one.
-- (NSData *)formDataForKey:(NSString *)key value:(NSString *)value;
-- (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name;
-- (NSData *)formDataForFile:(NSString *)file name:(NSString *)name;
+- (NSData*)formDataForKey:(NSString*)key value:(NSString*)value;
+- (NSData*)formDataForFileContents:(NSData*)contents name:(NSString*)name;
+- (NSData*)formDataForFile:(NSString*)file name:(NSString*)name;
@end
@implementation HTTPMultipartUpload
@@ -103,50 +46,39 @@ static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
#pragma mark -
#pragma mark || Private ||
//=============================================================================
-- (NSString *)multipartBoundary {
+- (NSString*)multipartBoundary {
// The boundary has 27 '-' characters followed by 16 hex digits
- return [NSString stringWithFormat:@"---------------------------%08X%08X",
- rand(), rand()];
-}
-
-//=============================================================================
-- (NSData *)formDataForKey:(NSString *)key value:(NSString *)value {
- 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];
-
- return [form dataUsingEncoding:NSUTF8StringEncoding];
+ return [NSString
+ stringWithFormat:@"---------------------------%08X%08X", rand(), rand()];
}
//=============================================================================
-- (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name {
- NSMutableData *data = [NSMutableData data];
- 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];
+- (NSData*)formDataForKey:(NSString*)key value:(NSString*)value {
+ NSMutableData* data = [NSMutableData data];
+ [self appendBoundaryData:data];
- [data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]];
- [data appendData:contents];
+ NSString* escaped = PercentEncodeNSString(key);
+ NSString* fmt = @"Content-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n";
+ NSString *form = [NSString stringWithFormat:fmt, escaped, value];
+ [data appendData:[form dataUsingEncoding:NSUTF8StringEncoding]];
return data;
}
//=============================================================================
-- (NSData *)formDataForFile:(NSString *)file name:(NSString *)name {
- NSData *contents = [NSData dataWithContentsOfFile:file];
+- (void)appendBoundaryData:(NSMutableData*)data {
+ NSString* fmt = @"--%@\r\n";
+ NSString* pre = [NSString stringWithFormat:fmt, boundary_];
- return [self formDataForFileContents:contents name:name];
+ [data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]];
}
//=============================================================================
#pragma mark -
#pragma mark || Public ||
//=============================================================================
-- (id)initWithURL:(NSURL *)url {
- if ((self = [super init])) {
- url_ = [url copy];
+- (id)initWithURL:(NSURL*)url {
+ if ((self = [super initWithURL:url])) {
boundary_ = [[self multipartBoundary] retain];
files_ = [[NSMutableDictionary alloc] init];
}
@@ -156,22 +88,15 @@ static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
//=============================================================================
- (void)dealloc {
- [url_ release];
[parameters_ release];
[files_ release];
[boundary_ release];
- [response_ release];
[super dealloc];
}
//=============================================================================
-- (NSURL *)URL {
- return url_;
-}
-
-//=============================================================================
-- (void)setParameters:(NSDictionary *)parameters {
+- (void)setParameters:(NSDictionary*)parameters {
if (parameters != parameters_) {
[parameters_ release];
parameters_ = [parameters copy];
@@ -179,40 +104,43 @@ static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
}
//=============================================================================
-- (NSDictionary *)parameters {
+- (NSDictionary*)parameters {
return parameters_;
}
//=============================================================================
-- (void)addFileAtPath:(NSString *)path name:(NSString *)name {
+- (void)addFileAtPath:(NSString*)path name:(NSString*)name {
[files_ setObject:path forKey:name];
}
//=============================================================================
-- (void)addFileContents:(NSData *)data name:(NSString *)name {
+- (void)addFileContents:(NSData*)data name:(NSString*)name {
[files_ setObject:data forKey:name];
}
//=============================================================================
-- (NSDictionary *)files {
+- (NSDictionary*)files {
return files_;
}
//=============================================================================
-- (NSData *)send:(NSError **)error {
- NSMutableURLRequest *req =
- [[NSMutableURLRequest alloc]
- initWithURL:url_ cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:60.0];
+- (NSString*)HTTPMethod {
+ return @"POST";
+}
- NSMutableData *postBody = [NSMutableData data];
+//=============================================================================
+- (NSString*)contentType {
+ return [NSString
+ stringWithFormat:@"multipart/form-data; boundary=%@", boundary_];
+}
- [req setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@",
- boundary_] forHTTPHeaderField:@"Content-type"];
+//=============================================================================
+- (NSData*)bodyData {
+ NSMutableData* postBody = [NSMutableData data];
// Add any parameters to the message
- NSArray *parameterKeys = [parameters_ allKeys];
- NSString *key;
+ NSArray* parameterKeys = [parameters_ allKeys];
+ NSString* key;
NSInteger count = [parameterKeys count];
for (NSInteger i = 0; i < count; ++i) {
@@ -222,46 +150,21 @@ static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
}
// Add any files to the message
- NSArray *fileNames = [files_ allKeys];
- for (NSString *name in fileNames) {
+ NSArray* fileNames = [files_ allKeys];
+ for (NSString* name in fileNames) {
+ // First append boundary
+ [self appendBoundaryData:postBody];
+ // Then the formdata
id fileOrData = [files_ objectForKey:name];
- NSData *fileData;
-
- // The object can be either the path to a file (NSString) or the contents
- // of the file (NSData).
- if ([fileOrData isKindOfClass:[NSData class]])
- fileData = [self formDataForFileContents:fileOrData name:name];
- else
- fileData = [self formDataForFile:fileOrData name:name];
-
- [postBody appendData:fileData];
+ [HTTPRequest appendFileToBodyData:postBody
+ withName:name
+ withFileOrData:fileOrData];
}
- NSString *epilogue = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary_];
+ NSString* epilogue = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary_];
[postBody appendData:[epilogue dataUsingEncoding:NSUTF8StringEncoding]];
- [req setHTTPBody:postBody];
- [req setHTTPMethod:@"POST"];
-
- [response_ release];
- response_ = nil;
-
- NSData *data = nil;
- if ([[req URL] isFileURL]) {
- [[req HTTPBody] writeToURL:[req URL] options:0 error:error];
- } else {
- NSURLResponse *response = nil;
- data = SendSynchronousNSURLRequest(req, &response, error);
- response_ = (NSHTTPURLResponse *)[response retain];
- }
- [req release];
-
- return data;
-}
-
-//=============================================================================
-- (NSHTTPURLResponse *)response {
- return response_;
+ return postBody;
}
@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.h b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.h
new file mode 100644
index 00000000000..431ea6104d7
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2020, 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.
+
+#import <Foundation/Foundation.h>
+
+#import "HTTPRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Represents an HTTP PUT request.
+ */
+@interface HTTPPutRequest : HTTPRequest {
+ @protected
+ NSString* file_;
+}
+
+/**
+ Sets the path of the file that will be sent in the PUT request.
+ */
+- (void)setFile:(NSString*)file;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.m b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.m
new file mode 100644
index 00000000000..ec67376b030
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPPutRequest.m
@@ -0,0 +1,62 @@
+// Copyright (c) 2020, 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.
+
+#import "HTTPPutRequest.h"
+
+@implementation HTTPPutRequest
+
+//=============================================================================
+- (void)dealloc {
+ [file_ release];
+
+ [super dealloc];
+}
+
+//=============================================================================
+- (void)setFile:(NSString*)file {
+ file_ = [file copy];
+}
+
+//=============================================================================
+- (NSString*)HTTPMethod {
+ return @"PUT";
+}
+
+//=============================================================================
+- (NSData*)bodyData {
+ NSMutableData* postBody = [NSMutableData data];
+
+ [HTTPRequest appendFileToBodyData:postBody
+ withName:@"symbol_file"
+ withFileOrData:file_];
+
+ return postBody;
+}
+
+@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.h b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.h
new file mode 100644
index 00000000000..b78fad6ba87
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.h
@@ -0,0 +1,73 @@
+// Copyright (c) 2020, 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.
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+/**
+ Represents a single HTTP request. Sending the request is synchronous.
+ Once the send is complete, the response will be set.
+
+ This is a base interface that specific HTTP requests derive from.
+ It is not intended to be instantiated directly.
+ */
+@interface HTTPRequest : NSObject {
+ @protected
+ NSURL* URL_; // The destination URL (STRONG)
+ NSHTTPURLResponse* response_; // The response from the send (STRONG)
+}
+
+/**
+ Initializes the HTTPRequest and sets its URL.
+ */
+- (id)initWithURL:(NSURL*)URL;
+
+- (NSURL*)URL;
+
+- (NSHTTPURLResponse*)response;
+
+- (NSString*)HTTPMethod; // Internal, don't call outside class hierarchy.
+
+- (NSString*)contentType; // Internal, don't call outside class hierarchy.
+
+- (NSData*)bodyData; // Internal, don't call outside class hierarchy.
+
+- (NSData*)send:(NSError**)error;
+
+/**
+ Appends a file to the HTTP request, either by filename or by file content
+ (in the form of NSData).
+ */
++ (void)appendFileToBodyData:(NSMutableData*)data
+ withName:(NSString*)name
+ withFileOrData:(id)fileOrData;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.m b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.m
new file mode 100644
index 00000000000..ee7de3af9f0
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPRequest.m
@@ -0,0 +1,213 @@
+// Copyright (c) 2020, 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.
+
+#import "HTTPRequest.h"
+
+#include <Availability.h>
+#include <AvailabilityMacros.h>
+
+#import "encoding_util.h"
+
+// 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** outResponse,
+ NSError** outError) {
+#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 waitSemaphone = dispatch_semaphore_create(0);
+ NSURLSessionConfiguration* config =
+ [NSURLSessionConfiguration defaultSessionConfiguration];
+ [config setTimeoutIntervalForRequest:240.0];
+ NSURLSession* session = [NSURLSession sessionWithConfiguration:config];
+ [[session
+ dataTaskWithRequest:req
+ completionHandler:^(NSData* data, NSURLResponse* resp, NSError* err) {
+ if (outError)
+ error = [err retain];
+ if (outResponse)
+ response = [resp retain];
+ if (err == nil)
+ result = [data retain];
+ dispatch_semaphore_signal(waitSemaphone);
+ }] resume];
+ dispatch_semaphore_wait(waitSemaphone, DISPATCH_TIME_FOREVER);
+ dispatch_release(waitSemaphone);
+ if (outError)
+ *outError = [error autorelease];
+ if (outResponse)
+ *outResponse = [response autorelease];
+ return [result autorelease];
+#else
+ return [NSURLConnection sendSynchronousRequest:req
+ returningResponse:outResponse
+ error:outError];
+#endif
+}
+
+@implementation HTTPRequest
+
+//=============================================================================
+- (id)initWithURL:(NSURL*)URL {
+ if ((self = [super init])) {
+ URL_ = [URL copy];
+ }
+
+ return self;
+}
+
+//=============================================================================
+- (void)dealloc {
+ [URL_ release];
+ [response_ release];
+
+ [super dealloc];
+}
+
+//=============================================================================
+- (NSURL*)URL {
+ return URL_;
+}
+
+//=============================================================================
+- (NSHTTPURLResponse*)response {
+ return response_;
+}
+
+//=============================================================================
+- (NSString*)HTTPMethod {
+ @throw [NSException
+ exceptionWithName:NSInternalInconsistencyException
+ reason:[NSString stringWithFormat:@"You must"
+ "override %@ in a subclass",
+ NSStringFromSelector(_cmd)]
+ userInfo:nil];
+}
+
+//=============================================================================
+- (NSString*)contentType {
+ return nil;
+}
+
+//=============================================================================
+- (NSData*)bodyData {
+ return nil;
+}
+
+//=============================================================================
+- (NSData*)send:(NSError**)withError {
+ NSMutableURLRequest* req = [[NSMutableURLRequest alloc]
+ initWithURL:URL_
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:60.0];
+
+ NSString* contentType = [self contentType];
+ if ([contentType length] > 0) {
+ [req setValue:contentType forHTTPHeaderField:@"Content-type"];
+ }
+
+ NSData* bodyData = [self bodyData];
+ if ([bodyData length] > 0) {
+ [req setHTTPBody:bodyData];
+ }
+
+ [req setHTTPMethod:[self HTTPMethod]];
+
+ [response_ release];
+ response_ = nil;
+
+ NSData* data = nil;
+ if ([[req URL] isFileURL]) {
+ [[req HTTPBody] writeToURL:[req URL] options:0 error:withError];
+ } else {
+ NSURLResponse* response = nil;
+ data = SendSynchronousNSURLRequest(req, &response, withError);
+ response_ = (NSHTTPURLResponse*)[response retain];
+ }
+ [req release];
+
+ return data;
+}
+
+//=============================================================================
++ (NSData*)formDataForFileContents:(NSData*)contents withName:(NSString*)name {
+ NSMutableData* data = [NSMutableData data];
+ NSString* escaped = PercentEncodeNSString(name);
+ NSString* fmt = @"Content-Disposition: form-data; name=\"%@\"; "
+ "filename=\"minidump.dmp\"\r\nContent-Type: "
+ "application/octet-stream\r\n\r\n";
+ NSString* pre = [NSString stringWithFormat:fmt, escaped];
+
+ [data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]];
+ [data appendData:contents];
+
+ return data;
+}
+
+//=============================================================================
++ (NSData*)formDataForFile:(NSString*)file withName:(NSString*)name {
+ NSData* contents = [NSData dataWithContentsOfFile:file];
+
+ return [HTTPRequest formDataForFileContents:contents withName:name];
+}
+
+//=============================================================================
++ (NSData*)formDataForKey:(NSString*)key value:(NSString*)value {
+ NSString* escaped = PercentEncodeNSString(key);
+ NSString* fmt = @"Content-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n";
+ NSString* form = [NSString stringWithFormat:fmt, escaped, value];
+
+ return [form dataUsingEncoding:NSUTF8StringEncoding];
+}
+
+//=============================================================================
++ (void)appendFileToBodyData:(NSMutableData*)data
+ withName:(NSString*)name
+ withFileOrData:(id)fileOrData {
+ NSData* fileData;
+
+ // The object can be either the path to a file (NSString) or the contents
+ // of the file (NSData).
+ if ([fileOrData isKindOfClass:[NSData class]])
+ fileData = [self formDataForFileContents:fileOrData withName:name];
+ else
+ fileData = [HTTPRequest formDataForFile:fileOrData withName:name];
+
+ [data appendData:fileData];
+}
+
+@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.h b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.h
new file mode 100644
index 00000000000..bfabfead663
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2020, 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.
+
+#import <Foundation/Foundation.h>
+
+#import "HTTPRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Represents a simple (non-multipart) HTTP POST request.
+ */
+@interface HTTPSimplePostRequest : HTTPRequest {
+ @protected
+ NSString* contentType_;
+ NSString* body_;
+}
+
+/**
+ Sets the content type of the POST request.
+ */
+- (void)setContentType:(NSString*)contentType;
+
+/**
+ Sets the contents of the POST request's body.
+ */
+- (void)setBody:(NSString*)body;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.m b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.m
new file mode 100644
index 00000000000..4cb3ef15944
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/HTTPSimplePostRequest.m
@@ -0,0 +1,69 @@
+// Copyright (c) 2020, 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.
+
+#import "HTTPSimplePostRequest.h"
+
+@implementation HTTPSimplePostRequest
+
+//=============================================================================
+- (void)dealloc {
+ [contentType_ release];
+ [body_ release];
+
+ [super dealloc];
+}
+
+//=============================================================================
+- (void)setContentType:(NSString*)contentType {
+ contentType_ = [contentType copy];
+}
+
+//=============================================================================
+- (void)setBody:(NSString*)body {
+ body_ = [body copy];
+}
+
+//=============================================================================
+- (NSString*)HTTPMethod {
+ return @"POST";
+}
+
+//=============================================================================
+- (NSString*)contentType {
+ return contentType_;
+}
+
+//=============================================================================
+- (NSData*)bodyData {
+ NSMutableData* data = [NSMutableData data];
+ [data appendData:[body_ dataUsingEncoding:NSUTF8StringEncoding]];
+ return data;
+}
+
+@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.h b/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.h
index 71419be98df..a3fae5a1492 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.h
@@ -73,7 +73,7 @@
// mach_port_t task = message.GetTranslatedPort(0);
// mach_port_t thread = message.GetTranslatedPort(1);
//
-// char *messageString = message.GetData();
+// char* messageString = message.GetData();
//
// printf("message string = %s\n", messageString);
// }
@@ -164,7 +164,7 @@ class MachMessage {
public:
// The receiver of the message can retrieve the raw data this way
- uint8_t *GetData() {
+ uint8_t* GetData() {
return GetDataLength() > 0 ? GetDataPacket()->data : NULL;
}
@@ -181,10 +181,10 @@ class MachMessage {
// Adds a descriptor (typically a mach port) to be translated
// returns true if successful, otherwise not enough space
- bool AddDescriptor(const MachMsgPortDescriptor &desc);
+ bool AddDescriptor(const MachMsgPortDescriptor& desc);
int GetDescriptorCount() const { return body.msgh_descriptor_count; }
- MachMsgPortDescriptor *GetDescriptor(int n);
+ MachMsgPortDescriptor* GetDescriptor(int n);
// Convenience method which gets the mach port described by the descriptor
mach_port_t GetTranslatedPort(int n);
@@ -193,7 +193,7 @@ class MachMessage {
bool IsSimpleMessage() const { return GetDescriptorCount() == 0; }
// Sets raw data for the message (returns false if not enough space)
- bool SetData(void *data, int32_t data_length);
+ bool SetData(void* data, int32_t data_length);
protected:
// Consider this an abstract base class - must create an actual instance
@@ -216,7 +216,7 @@ class MachMessage {
MessageDataPacket* GetDataPacket();
void SetDescriptorCount(int n);
- void SetDescriptor(int n, const MachMsgPortDescriptor &desc);
+ void SetDescriptor(int n, const MachMsgPortDescriptor& desc);
// Returns total message size setting msgh_size in the header to this value
mach_msg_size_t CalculateSize();
@@ -250,7 +250,7 @@ class MachSendMessage : public MachMessage {
class ReceivePort {
public:
// Creates a new mach port for receiving messages and registers a name for it
- explicit ReceivePort(const char *receive_port_name);
+ explicit ReceivePort(const char* receive_port_name);
// Given an already existing mach port, use it. We take ownership of the
// port and deallocate it in our destructor.
@@ -262,7 +262,7 @@ class ReceivePort {
~ReceivePort();
// Waits on the mach port until message received or timeout
- kern_return_t WaitForMessage(MachReceiveMessage *out_message,
+ kern_return_t WaitForMessage(MachReceiveMessage* out_message,
mach_msg_timeout_t timeout);
// The underlying mach port that we wrap
@@ -280,13 +280,13 @@ class ReceivePort {
class MachPortSender {
public:
// get a port with send rights corresponding to a named registered service
- explicit MachPortSender(const char *receive_port_name);
+ explicit MachPortSender(const char* receive_port_name);
// Given an already existing mach port, use it.
explicit MachPortSender(mach_port_t send_port);
- kern_return_t SendMessage(MachSendMessage &message,
+ kern_return_t SendMessage(MachSendMessage& message,
mach_msg_timeout_t timeout);
private:
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.mm b/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.mm
index dc9773f77ad..b41a825d476 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.mm
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/MachIPC.mm
@@ -52,7 +52,7 @@ MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() {
//==============================================================================
// returns true if successful
-bool MachMessage::SetData(void *data,
+bool MachMessage::SetData(void* data,
int32_t data_length) {
// first check to make sure we have enough space
size_t size = CalculateSize();
@@ -90,9 +90,9 @@ mach_msg_size_t MachMessage::CalculateSize() {
}
//==============================================================================
-MachMessage::MessageDataPacket *MachMessage::GetDataPacket() {
+MachMessage::MessageDataPacket* MachMessage::GetDataPacket() {
size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount();
- MessageDataPacket *packet =
+ MessageDataPacket* packet =
reinterpret_cast<MessageDataPacket*>(padding + desc_size);
return packet;
@@ -100,15 +100,15 @@ MachMessage::MessageDataPacket *MachMessage::GetDataPacket() {
//==============================================================================
void MachMessage::SetDescriptor(int n,
- const MachMsgPortDescriptor &desc) {
- MachMsgPortDescriptor *desc_array =
+ const MachMsgPortDescriptor& desc) {
+ MachMsgPortDescriptor* desc_array =
reinterpret_cast<MachMsgPortDescriptor*>(padding);
desc_array[n] = desc;
}
//==============================================================================
// returns true if successful otherwise there was not enough space
-bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) {
+bool MachMessage::AddDescriptor(const MachMsgPortDescriptor& desc) {
// first check to make sure we have enough space
int size = CalculateSize();
size_t new_size = size + sizeof(MachMsgPortDescriptor);
@@ -119,7 +119,7 @@ bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) {
// unfortunately, we need to move the data to allow space for the
// new descriptor
- u_int8_t *p = reinterpret_cast<u_int8_t*>(GetDataPacket());
+ u_int8_t* p = reinterpret_cast<u_int8_t*>(GetDataPacket());
bcopy(p, p+sizeof(MachMsgPortDescriptor), GetDataLength()+2*sizeof(int32_t));
SetDescriptor(GetDescriptorCount(), desc);
@@ -142,9 +142,9 @@ void MachMessage::SetDescriptorCount(int n) {
}
//==============================================================================
-MachMsgPortDescriptor *MachMessage::GetDescriptor(int n) {
+MachMsgPortDescriptor* MachMessage::GetDescriptor(int n) {
if (n < GetDescriptorCount()) {
- MachMsgPortDescriptor *desc =
+ MachMsgPortDescriptor* desc =
reinterpret_cast<MachMsgPortDescriptor*>(padding);
return desc + n;
}
@@ -164,7 +164,7 @@ mach_port_t MachMessage::GetTranslatedPort(int n) {
//==============================================================================
// create a new mach port for receiving messages and register a name for it
-ReceivePort::ReceivePort(const char *receive_port_name) {
+ReceivePort::ReceivePort(const char* receive_port_name) {
mach_port_t current_task = mach_task_self();
init_result_ = mach_port_allocate(current_task,
@@ -227,7 +227,7 @@ ReceivePort::~ReceivePort() {
}
//==============================================================================
-kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message,
+kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage* out_message,
mach_msg_timeout_t timeout) {
if (!out_message) {
return KERN_INVALID_ARGUMENT;
@@ -261,7 +261,7 @@ kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message,
//==============================================================================
// get a port with send rights corresponding to a named registered service
-MachPortSender::MachPortSender(const char *receive_port_name) {
+MachPortSender::MachPortSender(const char* receive_port_name) {
mach_port_t task_bootstrap_port = 0;
init_result_ = task_get_bootstrap_port(mach_task_self(),
&task_bootstrap_port);
@@ -281,7 +281,7 @@ MachPortSender::MachPortSender(mach_port_t send_port)
}
//==============================================================================
-kern_return_t MachPortSender::SendMessage(MachSendMessage &message,
+kern_return_t MachPortSender::SendMessage(MachSendMessage& message,
mach_msg_timeout_t timeout) {
if (message.head.msgh_size == 0) {
return KERN_INVALID_VALUE; // just for safety -- never should occur
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.h b/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.h
new file mode 100644
index 00000000000..1f27f23fd64
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.h
@@ -0,0 +1,102 @@
+// Copyright (c) 2020, 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.
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Represents a response from a sym-upload-v2 server to a createUploadURLOnServer
+ call.
+ */
+@interface UploadURLResponse : NSObject {
+ @protected
+ NSString* uploadURL_;
+ NSString* uploadKey_;
+}
+
+- (id)initWithUploadURL:(NSString*)uploadURL withUploadKey:(NSString*)uploadKey;
+
+- (NSString*)uploadURL;
+- (NSString*)uploadKey;
+@end
+
+/**
+ Possible return statuses from a sym-upload-v2 server to a
+ completeUploadOnServer call.
+ */
+typedef NS_ENUM(NSInteger, CompleteUploadResult) {
+ CompleteUploadResultOk,
+ CompleteUploadResultDuplicateData,
+ CompleteUploadResultError
+};
+
+/**
+ Possible return statuses from a sym-upload-v2 server to a
+ checkSymbolStatusOnServer call.
+ */
+typedef NS_ENUM(NSInteger, SymbolStatus) {
+ SymbolStatusFound,
+ SymbolStatusMissing,
+ SymbolStatusUnknown
+};
+
+/**
+ Interface to help a client interact with a sym-upload-v2 server, over HTTP.
+ For details of the API and protocol, see :/docs/sym_upload_v2_protocol.md.
+ */
+@interface SymbolCollectorClient : NSObject
+;
+
+/**
+ Calls the /v1/symbols/{debug_file}/{debug_id}:checkStatus API on the server.
+ */
++ (SymbolStatus)checkSymbolStatusOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey
+ withDebugFile:(NSString*)debugFile
+ withDebugID:(NSString*)debugID;
+
+/**
+ Calls the /v1/uploads:create API on the server.
+ */
++ (UploadURLResponse*)createUploadURLOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey;
+
+/**
+ Calls the /v1/uploads/{key}:complete API on the server.
+ */
++ (CompleteUploadResult)completeUploadOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey
+ withUploadKey:(NSString*)uploadKey
+ withDebugFile:(NSString*)debugFile
+ withDebugID:(NSString*)debugID;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.m b/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.m
new file mode 100644
index 00000000000..70f511f1016
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/SymbolCollectorClient.m
@@ -0,0 +1,240 @@
+// Copyright (c) 2020, 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.
+
+#import "SymbolCollectorClient.h"
+
+#import "HTTPGetRequest.h"
+#import "HTTPSimplePostRequest.h"
+
+@implementation UploadURLResponse
+
+//=============================================================================
+- (id)initWithUploadURL:(NSString*)uploadURL
+ withUploadKey:(NSString*)uploadKey {
+ if (self = [super init]) {
+ uploadURL_ = [uploadURL copy];
+ uploadKey_ = [uploadKey copy];
+ }
+ return self;
+}
+
+//=============================================================================
+- (void)dealloc {
+ [uploadURL_ release];
+ [uploadKey_ release];
+
+ [super dealloc];
+}
+
+//=============================================================================
+- (NSString*)uploadURL {
+ return uploadURL_;
+}
+
+//=============================================================================
+- (NSString*)uploadKey {
+ return uploadKey_;
+}
+@end
+
+@implementation SymbolCollectorClient
+
+//=============================================================================
++ (SymbolStatus)checkSymbolStatusOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey
+ withDebugFile:(NSString*)debugFile
+ withDebugID:(NSString*)debugID {
+ NSString* escapedDebugFile =
+ [debugFile stringByAddingPercentEncodingWithAllowedCharacters:
+ [NSCharacterSet URLHostAllowedCharacterSet]];
+
+ NSURL* URL = [NSURL
+ URLWithString:[NSString
+ stringWithFormat:@"%@/v1/symbols/%@/%@:checkStatus"
+ @"?key=%@",
+ APIURL, escapedDebugFile, debugID,
+ APIKey]];
+
+ HTTPGetRequest* getRequest = [[HTTPGetRequest alloc] initWithURL:URL];
+ NSError* error = nil;
+ NSData* data = [getRequest send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding];
+ int responseCode = [[getRequest response] statusCode];
+ [getRequest release];
+
+ if (error || responseCode != 200) {
+ fprintf(stdout, "Failed to check symbol status.\n");
+ fprintf(stdout, "Response code: %d\n", responseCode);
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return SymbolStatusUnknown;
+ }
+
+ error = nil;
+ NSRegularExpression* statusRegex = [NSRegularExpression
+ regularExpressionWithPattern:@"\"status\": \"([^\"]+)\""
+ options:0
+ error:&error];
+ NSArray* matches =
+ [statusRegex matchesInString:result
+ options:0
+ range:NSMakeRange(0, [result length])];
+ if ([matches count] != 1) {
+ fprintf(stdout, "Failed to parse check symbol status response.");
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return SymbolStatusUnknown;
+ }
+
+ NSString* status = [result substringWithRange:[matches[0] rangeAtIndex:1]];
+ [result release];
+
+ return [status isEqualToString:@"FOUND"] ? SymbolStatusFound
+ : SymbolStatusMissing;
+}
+
+//=============================================================================
++ (UploadURLResponse*)createUploadURLOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey {
+ NSURL* URL = [NSURL
+ URLWithString:[NSString stringWithFormat:@"%@/v1/uploads:create?key=%@",
+ APIURL, APIKey]];
+
+ HTTPSimplePostRequest* postRequest =
+ [[HTTPSimplePostRequest alloc] initWithURL:URL];
+ NSError* error = nil;
+ NSData* data = [postRequest send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding];
+ int responseCode = [[postRequest response] statusCode];
+ [postRequest release];
+
+ if (error || responseCode != 200) {
+ fprintf(stdout, "Failed to create upload URL.\n");
+ fprintf(stdout, "Response code: %d\n", responseCode);
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return nil;
+ }
+
+ // Note camel-case rather than underscores.
+ NSRegularExpression* uploadURLRegex = [NSRegularExpression
+ regularExpressionWithPattern:@"\"uploadUrl\": \"([^\"]+)\""
+ options:0
+ error:&error];
+ NSRegularExpression* uploadKeyRegex = [NSRegularExpression
+ regularExpressionWithPattern:@"\"uploadKey\": \"([^\"]+)\""
+ options:0
+ error:&error];
+
+ NSArray* uploadURLMatches =
+ [uploadURLRegex matchesInString:result
+ options:0
+ range:NSMakeRange(0, [result length])];
+ NSArray* uploadKeyMatches =
+ [uploadKeyRegex matchesInString:result
+ options:0
+ range:NSMakeRange(0, [result length])];
+ if ([uploadURLMatches count] != 1 || [uploadKeyMatches count] != 1) {
+ fprintf(stdout, "Failed to parse create url response.");
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return nil;
+ }
+ NSString* uploadURL =
+ [result substringWithRange:[uploadURLMatches[0] rangeAtIndex:1]];
+ NSString* uploadKey =
+ [result substringWithRange:[uploadKeyMatches[0] rangeAtIndex:1]];
+
+ return [[UploadURLResponse alloc] initWithUploadURL:uploadURL
+ withUploadKey:uploadKey];
+}
+
+//=============================================================================
++ (CompleteUploadResult)completeUploadOnServer:(NSString*)APIURL
+ withAPIKey:(NSString*)APIKey
+ withUploadKey:(NSString*)uploadKey
+ withDebugFile:(NSString*)debugFile
+ withDebugID:(NSString*)debugID {
+ NSURL* URL = [NSURL
+ URLWithString:[NSString
+ stringWithFormat:@"%@/v1/uploads/%@:complete?key=%@",
+ APIURL, uploadKey, APIKey]];
+ NSString* body =
+ [NSString stringWithFormat:
+ @"{ symbol_id: { debug_file: \"%@\", debug_id: \"%@\" } }",
+ debugFile, debugID];
+
+ HTTPSimplePostRequest* postRequest =
+ [[HTTPSimplePostRequest alloc] initWithURL:URL];
+ [postRequest setBody:body];
+ [postRequest setContentType:@"application/json"];
+
+ NSError* error = nil;
+ NSData* data = [postRequest send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding];
+ int responseCode = [[postRequest response] statusCode];
+ [postRequest release];
+
+ if (error || responseCode != 200) {
+ fprintf(stdout, "Failed to complete upload URL.\n");
+ fprintf(stdout, "Response code: %d\n", responseCode);
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return CompleteUploadResultError;
+ }
+
+ // Note camel-case rather than underscores.
+ NSRegularExpression* completeResultRegex = [NSRegularExpression
+ regularExpressionWithPattern:@"\"result\": \"([^\"]+)\""
+ options:0
+ error:&error];
+
+ NSArray* completeResultMatches =
+ [completeResultRegex matchesInString:result
+ options:0
+ range:NSMakeRange(0, [result length])];
+
+ if ([completeResultMatches count] != 1) {
+ fprintf(stdout, "Failed to parse complete upload response.");
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return CompleteUploadResultError;
+ }
+ NSString* completeResult =
+ [result substringWithRange:[completeResultMatches[0] rangeAtIndex:1]];
+ [result release];
+
+ return ([completeResult isEqualToString:@"DUPLICATE_DATA"])
+ ? CompleteUploadResultDuplicateData
+ : CompleteUploadResultOk;
+}
+@end
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.cc
index 3fbedd957d6..24bcd653d27 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.cc
@@ -120,7 +120,7 @@ vector<string> list_directory(const string& directory) {
namespace google_breakpad {
-bool DumpSymbols::Read(const string &filename) {
+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",
@@ -195,7 +195,7 @@ bool DumpSymbols::Read(const string &filename) {
// Get our own copy of fat_reader's object file list.
size_t object_files_count;
- const SuperFatArch *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",
@@ -212,7 +212,7 @@ bool DumpSymbols::Read(const string &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 SuperFatArch *best_match = FindBestMatchForArchitecture(
+ const SuperFatArch* best_match = FindBestMatchForArchitecture(
cpu_type, cpu_subtype);
if (!best_match) return false;
@@ -221,9 +221,9 @@ bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type,
return true;
}
-bool DumpSymbols::SetArchitecture(const std::string &arch_name) {
+bool DumpSymbols::SetArchitecture(const std::string& arch_name) {
bool arch_set = false;
- const NXArchInfo *arch_info =
+ const NXArchInfo* arch_info =
google_breakpad::BreakpadGetArchInfoFromName(arch_name.c_str());
if (arch_info) {
arch_set = SetArchitecture(arch_info->cputype, arch_info->cpusubtype);
@@ -251,7 +251,7 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture(
// 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
+ const struct fat_arch* best_match
= NXFindBestFatArch(cpu_type, cpu_subtype, &fat_arch_vector[0],
static_cast<uint32_t>(fat_arch_vector.size()));
@@ -311,7 +311,7 @@ string DumpSymbols::Identifier() {
class DumpSymbols::DumperRangesHandler:
public DwarfCUToModule::RangesHandler {
public:
- DumperRangesHandler(const uint8_t *buffer, uint64_t size,
+ DumperRangesHandler(const uint8_t* buffer, uint64_t size,
dwarf2reader::ByteReader* reader)
: buffer_(buffer), size_(size), reader_(reader) { }
@@ -325,7 +325,7 @@ class DumpSymbols::DumperRangesHandler:
}
private:
- const uint8_t *buffer_;
+ const uint8_t* buffer_;
uint64_t size_;
dwarf2reader::ByteReader* reader_;
};
@@ -337,22 +337,27 @@ class DumpSymbols::DumperLineToModule:
public DwarfCUToModule::LineToModuleHandler {
public:
// Create a line-to-module converter using BYTE_READER.
- DumperLineToModule(dwarf2reader::ByteReader *byte_reader)
+ DumperLineToModule(dwarf2reader::ByteReader* byte_reader)
: byte_reader_(byte_reader) { }
void StartCompilationUnit(const string& compilation_dir) {
compilation_dir_ = compilation_dir;
}
- void ReadProgram(const uint8_t *program, uint64_t length,
- Module *module, vector<Module::Line> *lines) {
+ void ReadProgram(const uint8_t* program, uint64_t length,
+ const uint8_t* string_section,
+ uint64_t string_section_length,
+ const uint8_t* line_string_section,
+ uint64_t line_string_section_length,
+ Module* module, vector<Module::Line>* lines) {
DwarfLineToModule handler(module, compilation_dir_, lines);
- dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
+ dwarf2reader::LineInfo parser(program, length, byte_reader_,
+ nullptr, 0, nullptr, 0, &handler);
parser.Start();
}
private:
string compilation_dir_;
- dwarf2reader::ByteReader *byte_reader_; // WEAK
+ dwarf2reader::ByteReader* byte_reader_; // WEAK
};
bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
@@ -364,7 +369,7 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
selected_object_file_ = &object_files_[0];
else {
// Look for an object file whose architecture matches our own.
- const NXArchInfo *local_arch = NXGetLocalArchInfo();
+ 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"
@@ -380,11 +385,11 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
// Find the name of the selected file's architecture, to appear in
// the MODULE record and in error messages.
- const NXArchInfo *selected_arch_info =
+ 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;
+ const char* selected_arch_name = selected_arch_info->name;
if (strcmp(selected_arch_name, "i386") == 0)
selected_arch_name = "x86";
@@ -413,9 +418,9 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
return true;
}
-void DumpSymbols::ReadDwarf(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::SectionMap &dwarf_sections,
+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 {
// Build a byte reader of the appropriate endianness.
ByteReader byte_reader(macho_reader.big_endian()
@@ -456,7 +461,7 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module *module,
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 =
+ const std::pair<const uint8_t*, uint64_t>& ranges_section =
ranges_entry->second;
ranges_handler.reset(
new DumperRangesHandler(ranges_section.first, ranges_section.second,
@@ -485,9 +490,9 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module *module,
}
}
-bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::Section &section,
+bool DumpSymbols::ReadCFI(google_breakpad::Module* module,
+ const mach_o::Reader& macho_reader,
+ const mach_o::Section& section,
bool eh_frame) const {
// Find the appropriate set of register names for this file's
// architecture.
@@ -506,7 +511,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
register_names = DwarfCFIToModule::RegisterNames::ARM64();
break;
default: {
- const NXArchInfo *arch = google_breakpad::BreakpadGetArchInfoFromCpuType(
+ const NXArchInfo* arch = google_breakpad::BreakpadGetArchInfoFromCpuType(
macho_reader.cpu_type(), macho_reader.cpu_subtype());
fprintf(stderr, "%s: cannot convert DWARF call frame information for ",
selected_object_name_.c_str());
@@ -521,7 +526,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
}
// Find the call frame information and its size.
- const uint8_t *cfi = 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.
@@ -553,9 +558,9 @@ class DumpSymbols::LoadCommandDumper:
public:
// Create a load command dumper handling load commands from READER's
// file, and adding data to MODULE.
- LoadCommandDumper(const DumpSymbols &dumper,
- google_breakpad::Module *module,
- const mach_o::Reader &reader,
+ LoadCommandDumper(const DumpSymbols& dumper,
+ google_breakpad::Module* module,
+ const mach_o::Reader& reader,
SymbolData symbol_data,
bool handle_inter_cu_refs)
: dumper_(dumper),
@@ -564,18 +569,18 @@ class DumpSymbols::LoadCommandDumper:
symbol_data_(symbol_data),
handle_inter_cu_refs_(handle_inter_cu_refs) { }
- bool SegmentCommand(const mach_o::Segment &segment);
- bool SymtabCommand(const ByteBuffer &entries, const ByteBuffer &strings);
+ bool SegmentCommand(const mach_o::Segment& segment);
+ bool SymtabCommand(const ByteBuffer& entries, const ByteBuffer& strings);
private:
- const DumpSymbols &dumper_;
- google_breakpad::Module *module_; // WEAK
- const mach_o::Reader &reader_;
+ const DumpSymbols& dumper_;
+ google_breakpad::Module* module_; // WEAK
+ const mach_o::Reader& reader_;
const SymbolData symbol_data_;
const bool handle_inter_cu_refs_;
};
-bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) {
+bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment& segment) {
mach_o::SectionMap section_map;
if (!reader_.MapSegmentSections(segment, &section_map))
return false;
@@ -610,8 +615,8 @@ bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) {
return true;
}
-bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer &entries,
- const ByteBuffer &strings) {
+bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer& entries,
+ const ByteBuffer& strings) {
StabsToModule stabs_to_module(module_);
// Mac OS X STABS are never "unitized", and the size of the 'value' field
// matches the address size of the executable.
@@ -653,7 +658,7 @@ bool DumpSymbols::ReadSymbolData(Module** out_module) {
return true;
}
-bool DumpSymbols::WriteSymbolFile(std::ostream &stream) {
+bool DumpSymbols::WriteSymbolFile(std::ostream& stream) {
Module* module = NULL;
if (ReadSymbolData(&module) && module) {
@@ -668,7 +673,7 @@ bool DumpSymbols::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 DumpSymbols::WriteSymbolFileHeader(std::ostream &stream) {
+bool DumpSymbols::WriteSymbolFileHeader(std::ostream& stream) {
scoped_ptr<Module> module;
if (!CreateEmptyModule(module))
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.h b/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.h
index 1e57f86ddd9..daebf876604 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/dump_syms.h
@@ -70,7 +70,7 @@ class DumpSymbols {
// 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.
- bool Read(const std::string &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
@@ -91,7 +91,7 @@ class DumpSymbols {
// the dumper will dump those symbols; and if it contains more than one
// object file, then the dumper will dump the object file whose
// architecture matches that of this dumper program.
- bool SetArchitecture(const std::string &arch_name);
+ bool SetArchitecture(const std::string& arch_name);
// Return a pointer to an array of SuperFatArch structures describing the
// object files contained in this dumper's file. Set *|count| to the number
@@ -100,7 +100,7 @@ class DumpSymbols {
//
// If there are no available architectures, this function
// may return NULL.
- const SuperFatArch* AvailableArchitectures(size_t *count) {
+ const SuperFatArch* AvailableArchitectures(size_t* count) {
*count = object_files_.size();
if (object_files_.size() > 0)
return &object_files_[0];
@@ -110,12 +110,12 @@ class DumpSymbols {
// Read the selected object file's debugging information, and write it out to
// |stream|. Return true on success; if an error occurs, report it and
// return false.
- bool WriteSymbolFile(std::ostream &stream);
+ 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);
+ 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
@@ -142,9 +142,9 @@ class DumpSymbols {
// Read debugging information from |dwarf_sections|, which was taken from
// |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,
+ void ReadDwarf(google_breakpad::Module* module,
+ const mach_o::Reader& macho_reader,
+ const mach_o::SectionMap& dwarf_sections,
bool handle_inter_cu_refs) const;
// Read DWARF CFI or .eh_frame data from |section|, belonging to
@@ -152,9 +152,9 @@ class DumpSymbols {
// then the data is .eh_frame-format data; otherwise, it is standard DWARF
// .debug_frame data. On success, return true; on failure, report
// the problem and return false.
- bool ReadCFI(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::Section &section,
+ bool ReadCFI(google_breakpad::Module* module,
+ const mach_o::Reader& macho_reader,
+ const mach_o::Section& section,
bool eh_frame) const;
// The selection of what type of symbol data to read/write.
@@ -184,7 +184,7 @@ class DumpSymbols {
// The object file in object_files_ selected to dump, or NULL if
// SetArchitecture hasn't been called yet.
- const SuperFatArch *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/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.h b/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.h
new file mode 100644
index 00000000000..6495a7427e4
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2020, 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_MAC_ENCODING_UTIL_H
+#define GOOGLE_BREAKPAD_COMMON_MAC_ENCODING_UTIL_H
+
+#import <Foundation/Foundation.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.
+NSString* PercentEncodeNSString(NSString* key);
+
+#endif // GOOGLE_BREAKPAD_COMMON_MAC_ENCODING_UTIL_H
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.m b/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.m
new file mode 100644
index 00000000000..86d70fb6ec0
--- /dev/null
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/encoding_util.m
@@ -0,0 +1,47 @@
+// Copyright (c) 2020, 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 "encoding_util.h"
+
+#include <Availability.h>
+#include <AvailabilityMacros.h>
+#import <Foundation/Foundation.h>
+
+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
+}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.cc
index c396ad888d8..3cf1d4b5f79 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.cc
@@ -53,7 +53,7 @@ using google_breakpad::MD5Init;
using google_breakpad::MD5Update;
using google_breakpad::MD5Final;
-MachoID::MachoID(const char *path)
+MachoID::MachoID(const char* path)
: memory_(0),
memory_size_(0),
crc_(0),
@@ -62,7 +62,7 @@ MachoID::MachoID(const char *path)
snprintf(path_, sizeof(path_), "%s", path);
}
-MachoID::MachoID(const char *path, void *memory, size_t size)
+MachoID::MachoID(const char* path, void* memory, size_t size)
: memory_(memory),
memory_size_(size),
crc_(0),
@@ -82,7 +82,7 @@ MachoID::~MachoID() {
// MAX_BLOCK is the largest n such that 255n(n+1)/2 + (n+1)(MAX_BLOCK-1) <= 2^32-1
#define MAX_BLOCK 5552
-void MachoID::UpdateCRC(unsigned char *bytes, size_t size) {
+void MachoID::UpdateCRC(unsigned char* bytes, size_t size) {
// Unrolled loops for summing
#define DO1(buf,i) {sum1 += (buf)[i]; sum2 += sum1;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
@@ -122,11 +122,11 @@ void MachoID::UpdateCRC(unsigned char *bytes, size_t size) {
}
}
-void MachoID::UpdateMD5(unsigned char *bytes, size_t size) {
+void MachoID::UpdateMD5(unsigned char* bytes, size_t size) {
MD5Update(&md5_context_, bytes, static_cast<unsigned>(size));
}
-void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) {
+void MachoID::Update(MachoWalker* walker, off_t offset, size_t size) {
if (!update_function_ || !size)
return;
@@ -237,7 +237,7 @@ bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char
bool MachoID::WalkHeader(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype,
MachoWalker::LoadCommandCallback callback,
- void *context) {
+ void* context) {
if (memory_) {
MachoWalker walker(memory_, memory_size_, callback, context);
return walker.WalkHeader(cpu_type, cpu_subtype);
@@ -248,9 +248,9 @@ bool MachoID::WalkHeader(cpu_type_t cpu_type,
}
// static
-bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
- MachoID *macho_id = (MachoID *)context;
+bool MachoID::WalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context) {
+ MachoID* macho_id = (MachoID*)context;
if (cmd->cmd == LC_SEGMENT) {
struct segment_command seg;
@@ -327,11 +327,11 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
}
// static
-bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
+bool MachoID::UUIDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context) {
if (cmd->cmd == LC_UUID) {
- struct breakpad_uuid_command *uuid_cmd =
- (struct breakpad_uuid_command *)context;
+ struct breakpad_uuid_command* uuid_cmd =
+ (struct breakpad_uuid_command*)context;
if (!walker->ReadBytes(uuid_cmd, sizeof(struct breakpad_uuid_command),
offset))
@@ -348,10 +348,10 @@ bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
}
// static
-bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
+bool MachoID::IDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context) {
if (cmd->cmd == LC_ID_DYLIB) {
- struct dylib_command *dylib_cmd = (struct dylib_command *)context;
+ struct dylib_command* dylib_cmd = (struct dylib_command*)context;
if (!walker->ReadBytes(dylib_cmd, sizeof(struct dylib_command), offset))
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.h b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.h
index 1037549124a..e8874c37cdf 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_id.h
@@ -45,8 +45,8 @@ namespace MacFileUtilities {
class MachoID {
public:
- MachoID(const char *path);
- MachoID(const char *path, void *memory, size_t size);
+ MachoID(const char* path);
+ MachoID(const char* path, void* memory, size_t size);
~MachoID();
// For the given |cpu_type| and |cpu_subtype|, return a UUID from the LC_UUID
@@ -78,40 +78,40 @@ class MachoID {
private:
// Signature of class member function to be called with data read from file
- typedef void (MachoID::*UpdateFunction)(unsigned char *bytes, size_t size);
+ typedef void (MachoID::*UpdateFunction)(unsigned char* bytes, size_t size);
// Update the CRC value by examining |size| |bytes| and applying the algorithm
// to each byte.
- void UpdateCRC(unsigned char *bytes, size_t size);
+ void UpdateCRC(unsigned char* bytes, size_t size);
// Update the MD5 value by examining |size| |bytes| and applying the algorithm
// to each byte.
- void UpdateMD5(unsigned char *bytes, size_t size);
+ void UpdateMD5(unsigned char* bytes, size_t size);
// Bottleneck for update routines
- void Update(MachoWalker *walker, off_t offset, size_t size);
+ void Update(MachoWalker* walker, off_t offset, size_t size);
// Factory for the MachoWalker
bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype,
- MachoWalker::LoadCommandCallback callback, void *context);
+ MachoWalker::LoadCommandCallback callback, void* context);
// The callback from the MachoWalker for CRC and MD5
- static bool WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
+ static bool WalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context);
// The callback from the MachoWalker for LC_UUID
- static bool UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
+ static bool UUIDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context);
// The callback from the MachoWalker for LC_ID_DYLIB
- static bool IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
+ static bool IDWalkerCB(MachoWalker* walker, load_command* cmd, off_t offset,
+ bool swap, void* context);
// File path
char path_[PATH_MAX];
// Memory region to read from
- void *memory_;
+ void* memory_;
// Size of the memory region
size_t memory_size_;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.cc
index 91e1fdd2b2a..b42506ccee5 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.cc
@@ -81,7 +81,7 @@ void FatReader::Reporter::MisplacedObjectFile() {
" to contain\n", filename_.c_str());
}
-bool FatReader::Read(const uint8_t *buffer, size_t size) {
+bool FatReader::Read(const uint8_t* buffer, size_t size) {
buffer_.start = buffer;
buffer_.end = buffer + size;
ByteCursor cursor(&buffer_);
@@ -196,19 +196,19 @@ void Reader::Reporter::LoadCommandTooShort(size_t i, LoadCommandType type) {
filename_.c_str(), i, type);
}
-void Reader::Reporter::SectionsMissing(const string &name) {
+void Reader::Reporter::SectionsMissing(const string& name) {
fprintf(stderr, "%s: the load command for segment '%s'"
" is too short to hold the section headers it claims to have\n",
filename_.c_str(), name.c_str());
}
-void Reader::Reporter::MisplacedSegmentData(const string &name) {
+void Reader::Reporter::MisplacedSegmentData(const string& name) {
fprintf(stderr, "%s: the segment '%s' claims its contents lie beyond"
" the end of the file\n", filename_.c_str(), name.c_str());
}
-void Reader::Reporter::MisplacedSectionData(const string &section,
- const string &segment) {
+void Reader::Reporter::MisplacedSectionData(const string& section,
+ const string& segment) {
fprintf(stderr, "%s: the section '%s' in segment '%s'"
" claims its contents lie outside the segment's contents\n",
filename_.c_str(), section.c_str(), segment.c_str());
@@ -225,7 +225,7 @@ void Reader::Reporter::UnsupportedCPUType(cpu_type_t cpu_type) {
filename_.c_str(), cpu_type);
}
-bool Reader::Read(const uint8_t *buffer,
+bool Reader::Read(const uint8_t* buffer,
size_t size,
cpu_type_t expected_cpu_type,
cpu_subtype_t expected_cpu_subtype) {
@@ -309,7 +309,7 @@ bool Reader::Read(const uint8_t *buffer,
return true;
}
-bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
+bool Reader::WalkLoadCommands(Reader::LoadCommandHandler* handler) const {
ByteCursor list_cursor(&load_commands_, big_endian_);
for (size_t index = 0; index < load_command_count_; ++index) {
@@ -422,13 +422,13 @@ 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.
bool found() const { return found_; }
- bool SegmentCommand(const Segment &segment) {
+ bool SegmentCommand(const Segment& segment) {
if (segment.name == name_) {
*segment_ = segment;
found_ = true;
@@ -439,23 +439,23 @@ class Reader::SegmentFinder : public LoadCommandHandler {
private:
// The name of the segment our creator is looking for.
- const string &name_;
+ const string& name_;
// Where we should store the segment if found. (WEAK)
- Segment *segment_;
+ Segment* segment_;
// True if we found the segment.
bool found_;
};
-bool Reader::FindSegment(const string &name, Segment *segment) const {
+bool Reader::FindSegment(const string& name, Segment* segment) const {
SegmentFinder finder(name, segment);
WalkLoadCommands(&finder);
return finder.found();
}
-bool Reader::WalkSegmentSections(const Segment &segment,
- SectionHandler *handler) const {
+bool Reader::WalkSegmentSections(const Segment& segment,
+ SectionHandler* handler) const {
size_t word_size = segment.bits_64 ? 8 : 4;
ByteCursor cursor(&segment.section_list, big_endian_);
@@ -537,18 +537,18 @@ class Reader::SectionMapper: public SectionHandler {
public:
// Create a SectionHandler that populates MAP with an entry for
// each section it is given.
- SectionMapper(SectionMap *map) : map_(map) { }
- bool HandleSection(const Section &section) {
+ SectionMapper(SectionMap* map) : map_(map) { }
+ bool HandleSection(const Section& section) {
(*map_)[section.section_name] = section;
return true;
}
private:
// The map under construction. (WEAK)
- SectionMap *map_;
+ SectionMap* map_;
};
-bool Reader::MapSegmentSections(const Segment &segment,
- SectionMap *section_map) const {
+bool Reader::MapSegmentSections(const Segment& segment,
+ SectionMap* section_map) const {
section_map->clear();
SectionMapper mapper(section_map);
return WalkSegmentSections(segment, &mapper);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.h b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.h
index 145d17d1f2a..02762c55c56 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader.h
@@ -78,7 +78,7 @@ class FatReader {
class Reporter {
public:
// Create a reporter that attributes problems to |filename|.
- explicit Reporter(const string &filename) : filename_(filename) { }
+ explicit Reporter(const string& filename) : filename_(filename) { }
virtual ~Reporter() { }
@@ -101,7 +101,7 @@ class FatReader {
};
// Create a fat binary file reader that uses |reporter| to report problems.
- explicit FatReader(Reporter *reporter) : reporter_(reporter) { }
+ 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
@@ -110,7 +110,7 @@ class FatReader {
// If the data is a plain Mach-O file, rather than a fat binary file,
// then the reader behaves as if it had found a fat binary file whose
// single object file is the Mach-O file.
- bool Read(const uint8_t *buffer, size_t size);
+ bool Read(const uint8_t* buffer, size_t size);
// Return an array of 'SuperFatArch' structures describing the
// object files present in this fat binary file. Set |size| to the
@@ -130,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 SuperFatArch* 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];
@@ -139,7 +139,7 @@ class FatReader {
private:
// We use this to report problems parsing the file's contents. (WEAK)
- Reporter *reporter_;
+ Reporter* reporter_;
// The contents of the fat binary or Mach-O file we're parsing. We do not
// own the storage it refers to.
@@ -240,7 +240,7 @@ class Reader {
class Reporter {
public:
// Create a reporter that attributes problems to |filename|.
- explicit Reporter(const string &filename) : filename_(filename) { }
+ explicit Reporter(const string& filename) : filename_(filename) { }
virtual ~Reporter() { }
// Reporter functions for fatal errors return void; the reader will
@@ -282,16 +282,16 @@ class Reader {
// The LC_SEGMENT or LC_SEGMENT_64 load command for the segment named
// |name| is too short to hold the sections that its header says it does.
// (This more specific than LoadCommandTooShort.)
- virtual void SectionsMissing(const string &name);
+ virtual void SectionsMissing(const string& name);
// The segment named |name| claims that its contents lie beyond the end
// of the file.
- virtual void MisplacedSegmentData(const string &name);
+ virtual void MisplacedSegmentData(const string& name);
// The section named |section| in the segment named |segment| claims that
// its contents do not lie entirely within the segment.
- virtual void MisplacedSectionData(const string &section,
- const string &segment);
+ virtual void MisplacedSectionData(const string& section,
+ const string& segment);
// The LC_SYMTAB command claims that symbol table contents are located
// beyond the end of the file.
@@ -315,7 +315,7 @@ class Reader {
// Called to report that the segment's section list contains |section|.
// This should return true if the iteration should continue, or false
// if it should stop.
- virtual bool HandleSection(const Section &section) = 0;
+ virtual bool HandleSection(const Section& section) = 0;
};
// A handler for the load commands in a Mach-O file.
@@ -341,20 +341,20 @@ class Reader {
// cannot parse the command type or its size, we call
// reporter_->IncompleteLoadCommand instead.)
virtual bool UnknownCommand(LoadCommandType type,
- const ByteBuffer &contents) {
+ const ByteBuffer& contents) {
return true;
}
// The load command is LC_SEGMENT or LC_SEGMENT_64, defining a segment
// with the properties given in |segment|.
- virtual bool SegmentCommand(const Segment &segment) {
+ virtual bool SegmentCommand(const Segment& segment) {
return true;
}
// The load command is LC_SYMTAB. |entries| holds the array of nlist
// entries, and |names| holds the strings the entries refer to.
- virtual bool SymtabCommand(const ByteBuffer &entries,
- const ByteBuffer &names) {
+ virtual bool SymtabCommand(const ByteBuffer& entries,
+ const ByteBuffer& names) {
return true;
}
@@ -362,7 +362,7 @@ class Reader {
};
// Create a Mach-O file reader that reports problems to |reporter|.
- explicit Reader(Reporter *reporter)
+ explicit Reader(Reporter* reporter)
: reporter_(reporter) { }
// Read the given data as a Mach-O file. The reader retains pointers
@@ -371,11 +371,11 @@ class Reader {
//
// At most one of these functions should be invoked once on each Reader
// instance.
- bool Read(const uint8_t *buffer,
+ bool Read(const uint8_t* buffer,
size_t size,
cpu_type_t expected_cpu_type,
cpu_subtype_t expected_cpu_subtype);
- bool Read(const ByteBuffer &buffer,
+ bool Read(const ByteBuffer& buffer,
cpu_type_t expected_cpu_type,
cpu_subtype_t expected_cpu_subtype) {
return Read(buffer.start,
@@ -402,25 +402,25 @@ class Reader {
// a handler function returns false. If we encounter a malformed load
// command, report it via reporter_ and return false. Return true if all
// load commands were parseable and all handlers returned true.
- bool WalkLoadCommands(LoadCommandHandler *handler) const;
+ bool WalkLoadCommands(LoadCommandHandler* handler) const;
// Set |segment| to describe the segment named |name|, if present. If
// found, |segment|'s byte buffers refer to a subregion of the bytes
// passed to Read. If we find the section, return true; otherwise,
// return false.
- bool FindSegment(const string &name, Segment *segment) const;
+ bool FindSegment(const string& name, Segment* segment) const;
// Apply |handler| to each section defined in |segment|. If |handler| returns
// false, stop iterating and return false. If all calls to |handler| return
// true and we reach the end of the section list, return true.
- bool WalkSegmentSections(const Segment &segment, SectionHandler *handler)
+ bool WalkSegmentSections(const Segment& segment, SectionHandler* handler)
const;
// Clear |section_map| and then populate it with a map of the sections
// in |segment|, from section names to Section structures.
// Each Section's contents refer to bytes in |segment|'s contents.
// On success, return true; if a problem occurs, report it and return false.
- bool MapSegmentSections(const Segment &segment, SectionMap *section_map)
+ bool MapSegmentSections(const Segment& segment, SectionMap* section_map)
const;
private:
@@ -429,7 +429,7 @@ class Reader {
class SectionMapper;
// We use this to report problems parsing the file's contents. (WEAK)
- Reporter *reporter_;
+ Reporter* reporter_;
// The contents of the Mach-O file we're parsing. We do not own the
// storage it refers to.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader_unittest.cc
index d8459d8cd4b..dccda4e7ba4 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_reader_unittest.cc
@@ -75,7 +75,7 @@ using testing::_;
class MockFatReaderReporter: public FatReader::Reporter {
public:
- MockFatReaderReporter(const string &filename)
+ MockFatReaderReporter(const string& filename)
: FatReader::Reporter(filename) { }
MOCK_METHOD0(BadHeader, void());
MOCK_METHOD0(MisplacedObjectFile, void());
@@ -84,7 +84,7 @@ class MockFatReaderReporter: public FatReader::Reporter {
class MockReaderReporter: public Reader::Reporter {
public:
- MockReaderReporter(const string &filename) : Reader::Reporter(filename) { }
+ MockReaderReporter(const string& filename) : Reader::Reporter(filename) { }
MOCK_METHOD0(BadHeader, void());
MOCK_METHOD4(CPUTypeMismatch, void(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype,
@@ -95,24 +95,24 @@ class MockReaderReporter: public Reader::Reporter {
MOCK_METHOD3(LoadCommandsOverrun, void(size_t claimed, size_t i,
LoadCommandType type));
MOCK_METHOD2(LoadCommandTooShort, void(size_t i, LoadCommandType type));
- MOCK_METHOD1(SectionsMissing, void(const string &name));
- MOCK_METHOD1(MisplacedSegmentData, void(const string &name));
- MOCK_METHOD2(MisplacedSectionData, void(const string &section,
- const string &segment));
+ MOCK_METHOD1(SectionsMissing, void(const string& name));
+ MOCK_METHOD1(MisplacedSegmentData, void(const string& name));
+ MOCK_METHOD2(MisplacedSectionData, void(const string& section,
+ const string& segment));
MOCK_METHOD0(MisplacedSymbolTable, void());
MOCK_METHOD1(UnsupportedCPUType, void(cpu_type_t cpu_type));
};
class MockLoadCommandHandler: public Reader::LoadCommandHandler {
public:
- MOCK_METHOD2(UnknownCommand, bool(LoadCommandType, const ByteBuffer &));
- MOCK_METHOD1(SegmentCommand, bool(const Segment &));
- MOCK_METHOD2(SymtabCommand, bool(const ByteBuffer &, const ByteBuffer &));
+ MOCK_METHOD2(UnknownCommand, bool(LoadCommandType, const ByteBuffer&));
+ MOCK_METHOD1(SegmentCommand, bool(const Segment&));
+ MOCK_METHOD2(SymtabCommand, bool(const ByteBuffer&, const ByteBuffer&));
};
class MockSectionHandler: public Reader::SectionHandler {
public:
- MOCK_METHOD1(HandleSection, bool(const Section &section));
+ MOCK_METHOD1(HandleSection, bool(const Section& section));
};
@@ -221,7 +221,7 @@ struct FatReaderFixture {
}
void ReadFat(bool expect_parse_success = true) {
ASSERT_TRUE(fat.GetContents(&contents));
- fat_bytes = reinterpret_cast<const uint8_t *>(contents.data());
+ fat_bytes = reinterpret_cast<const uint8_t*>(contents.data());
if (expect_parse_success) {
EXPECT_TRUE(reader.Read(fat_bytes, contents.size()));
size_t fat_files_count;
@@ -238,7 +238,7 @@ struct FatReaderFixture {
MockFatReaderReporter reporter;
FatReader reader;
string contents;
- const uint8_t *fat_bytes;
+ const uint8_t* fat_bytes;
vector<struct fat_arch> object_files;
};
@@ -487,16 +487,16 @@ class WithConfiguration {
private:
// The innermost WithConfiguration in whose dynamic scope we are
// currently executing.
- static WithConfiguration *current_;
+ static WithConfiguration* current_;
// The innermost WithConfiguration whose dynamic scope encloses this
// WithConfiguration.
Endianness endianness_;
size_t word_size_;
- WithConfiguration *saved_;
+ WithConfiguration* saved_;
};
-WithConfiguration *WithConfiguration::current_ = NULL;
+WithConfiguration* WithConfiguration::current_ = NULL;
// A test_assembler::Section with a size that we can cite. The start(),
// Here() and Mark() member functions of a SizedSection always represent
@@ -527,7 +527,7 @@ class SizedSection: public test_assembler::Section {
// Append SECTION to the end of this section, and call its Finish member.
// Return a reference to this section.
- SizedSection &Place(SizedSection *section) {
+ SizedSection& Place(SizedSection* section) {
assert(section->endianness() == endianness());
section->Finish();
section->start() = Here();
@@ -563,7 +563,7 @@ class LoadedSection: public SizedSection {
// Placing a loaded section within a loaded section sets the relationship
// between their addresses.
- LoadedSection &Place(LoadedSection *section) {
+ LoadedSection& Place(LoadedSection* section) {
section->address() = address() + Size();
SizedSection::Place(section);
return *this;
@@ -583,7 +583,7 @@ class SegmentLoadCommand: public SizedSection {
// The load command will refer to CONTENTS, which must be Placed in the
// file separately, at the desired position. Return a reference to this
// section.
- SegmentLoadCommand &Header(const string &name, const LoadedSection &contents,
+ SegmentLoadCommand& Header(const string& name, const LoadedSection& contents,
uint32_t maxprot, uint32_t initprot,
uint32_t flags) {
assert(contents.word_size() == word_size());
@@ -608,16 +608,16 @@ class SegmentLoadCommand: public SizedSection {
// memory. If this label is still undefined by the time we place this
// segment, it defaults to the final size of the segment's in-file
// contents. Return a reference to this load command.
- Label &vmsize() { return vmsize_; }
+ Label& vmsize() { return vmsize_; }
// Add a section entry with the given characteristics to this segment
// load command. Return a reference to this. The section entry will refer
// to CONTENTS, which must be Placed in the segment's contents
// separately, at the desired position.
- SegmentLoadCommand &AppendSectionEntry(const string &section_name,
- const string &segment_name,
+ SegmentLoadCommand& AppendSectionEntry(const string& section_name,
+ const string& segment_name,
uint32_t alignment, uint32_t flags,
- const LoadedSection &contents) {
+ const LoadedSection& contents) {
AppendCString(section_name, 16);
AppendCString(segment_name, 16);
Append(endianness(), word_size() / 8, contents.address());
@@ -671,14 +671,14 @@ class LoadCommands: public SizedSection {
Label final_command_count() const { return final_command_count_; }
// Increment the command count; return a reference to this section.
- LoadCommands &CountCommand() {
+ LoadCommands& CountCommand() {
command_count_++;
return *this;
}
// Place COMMAND, containing a load command, at the end of this section.
// Return a reference to this section.
- LoadCommands &Place(SizedSection *section) {
+ LoadCommands& Place(SizedSection* section) {
SizedSection::Place(section);
CountCommand();
return *this;
@@ -710,7 +710,7 @@ class MachOFile: public SizedSection {
// Create a Mach-O file header using the given characteristics and load
// command list. This Places COMMANDS immediately after the header.
// Return a reference to this section.
- MachOFile &Header(LoadCommands *commands,
+ MachOFile& Header(LoadCommands* commands,
cpu_type_t cpu_type = CPU_TYPE_X86,
cpu_subtype_t cpu_subtype = CPU_SUBTYPE_I386_ALL,
FileType file_type = MH_EXECUTE,
@@ -752,12 +752,12 @@ struct ReaderFixture {
EXPECT_CALL(load_command_handler, SegmentCommand(_)).Times(0);
}
- void ReadFile(MachOFile *file,
+ void ReadFile(MachOFile* file,
bool expect_parse_success,
cpu_type_t expected_cpu_type,
cpu_subtype_t expected_cpu_subtype) {
ASSERT_TRUE(file->GetContents(&file_contents));
- file_bytes = reinterpret_cast<const uint8_t *>(file_contents.data());
+ file_bytes = reinterpret_cast<const uint8_t*>(file_contents.data());
if (expect_parse_success) {
EXPECT_TRUE(reader.Read(file_bytes,
file_contents.size(),
@@ -772,7 +772,7 @@ struct ReaderFixture {
}
string file_contents;
- const uint8_t *file_bytes;
+ const uint8_t* file_bytes;
MockReaderReporter reporter;
Reader reader;
MockLoadCommandHandler load_command_handler;
@@ -1343,14 +1343,14 @@ TEST_F(LoadCommand, ThreeLoadCommands) {
EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
}
-static inline Matcher<const Section &> MatchSection(
+static inline Matcher<const Section&> MatchSection(
Matcher<bool> bits_64,
- Matcher<const string &> section_name,
- Matcher<const string &> segment_name,
+ Matcher<const string&> section_name,
+ Matcher<const string&> segment_name,
Matcher<uint64_t> address,
Matcher<uint32_t> alignment,
Matcher<uint32_t> flags,
- Matcher<const ByteBuffer &> contents) {
+ Matcher<const ByteBuffer&> contents) {
return AllOf(AllOf(Field(&Section::bits_64, bits_64),
Field(&Section::section_name, section_name),
Field(&Section::segment_name, segment_name),
@@ -1360,10 +1360,10 @@ static inline Matcher<const Section &> MatchSection(
Field(&Section::contents, contents)));
}
-static inline Matcher<const Section &> MatchSection(
+static inline Matcher<const Section&> MatchSection(
Matcher<bool> bits_64,
- Matcher<const string &> section_name,
- Matcher<const string &> segment_name,
+ Matcher<const string&> section_name,
+ Matcher<const string&> segment_name,
Matcher<uint64_t> address) {
return AllOf(Field(&Section::bits_64, bits_64),
Field(&Section::section_name, section_name),
@@ -1410,7 +1410,7 @@ TEST_F(LoadCommand, OneSegmentTwoSections) {
contents1.start = file_bytes + section1.start().Value();
contents1.end = contents1.start + section1.final_size().Value();
EXPECT_EQ("buddha's hand",
- string(reinterpret_cast<const char *>(contents1.start),
+ string(reinterpret_cast<const char*>(contents1.start),
contents1.Size()));
EXPECT_CALL(section_handler,
HandleSection(MatchSection(true, "mandarin", "kishu",
@@ -1422,7 +1422,7 @@ TEST_F(LoadCommand, OneSegmentTwoSections) {
contents2.start = file_bytes + section2.start().Value();
contents2.end = contents2.start + section2.final_size().Value();
EXPECT_EQ("kumquat",
- string(reinterpret_cast<const char *>(contents2.start),
+ string(reinterpret_cast<const char*>(contents2.start),
contents2.Size()));
EXPECT_CALL(section_handler,
HandleSection(MatchSection(true, "bergamot", "cara cara",
@@ -1716,7 +1716,7 @@ class StringAssembler: public SizedSection {
public:
// Add the string S to this StringAssembler, and return the string's
// offset within this compilation unit's strings.
- size_t Add(const string &s) {
+ size_t Add(const string& s) {
size_t offset = Size();
AppendCString(s);
return offset;
@@ -1728,7 +1728,7 @@ class StringAssembler: public SizedSection {
class SymbolAssembler: public SizedSection {
public:
// Create a SymbolAssembler that uses StringAssembler for its strings.
- explicit SymbolAssembler(StringAssembler *string_assembler)
+ explicit SymbolAssembler(StringAssembler* string_assembler)
: string_assembler_(string_assembler),
entry_count_(0) { }
@@ -1737,7 +1737,7 @@ class SymbolAssembler: public SizedSection {
// its compilation unit's portion of the .stabstr section; this can be a
// value generated by a StringAssembler. Return a reference to this
// SymbolAssembler.
- SymbolAssembler &Symbol(uint8_t type, uint8_t other, Label descriptor,
+ SymbolAssembler& Symbol(uint8_t type, uint8_t other, Label descriptor,
Label value, Label name) {
D32(name);
D8(type);
@@ -1749,14 +1749,14 @@ class SymbolAssembler: public SizedSection {
}
// As above, but automatically add NAME to our StringAssembler.
- SymbolAssembler &Symbol(uint8_t type, uint8_t other, Label descriptor,
- Label value, const string &name) {
+ SymbolAssembler& Symbol(uint8_t type, uint8_t other, Label descriptor,
+ Label value, const string& name) {
return Symbol(type, other, descriptor, value, string_assembler_->Add(name));
}
private:
// The strings for our STABS entries.
- StringAssembler *string_assembler_;
+ StringAssembler* string_assembler_;
// The number of entries in this compilation unit so far.
size_t entry_count_;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.cc
index 1acd86656b6..a42128b8053 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.cc
@@ -47,8 +47,8 @@
namespace MacFileUtilities {
-MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
- void *context)
+MachoWalker::MachoWalker(const char* path, LoadCommandCallback callback,
+ void* context)
: file_(-1),
memory_(NULL),
memory_size_(0),
@@ -60,8 +60,8 @@ MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
file_ = open(path, O_RDONLY);
}
-MachoWalker::MachoWalker(void *memory, size_t size,
- LoadCommandCallback callback, void *context)
+MachoWalker::MachoWalker(void* memory, size_t size,
+ LoadCommandCallback callback, void* context)
: file_(-1),
memory_(memory),
memory_size_(size),
@@ -82,7 +82,7 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
cpu_subtype_t valid_cpu_subtype = cpu_subtype;
// if |cpu_type| is 0, use the native cpu type.
if (cpu_type == 0) {
- const NXArchInfo *arch = NXGetLocalArchInfo();
+ const NXArchInfo* arch = NXGetLocalArchInfo();
assert(arch);
valid_cpu_type = arch->cputype;
valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE;
@@ -98,7 +98,7 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
return false;
}
-bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
+bool MachoWalker::ReadBytes(void* buffer, size_t size, off_t offset) {
if (memory_) {
if (offset < 0)
return false;
@@ -109,14 +109,14 @@ bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
size = memory_size_ - static_cast<size_t>(offset);
result = false;
}
- memcpy(buffer, static_cast<char *>(memory_) + offset, size);
+ memcpy(buffer, static_cast<char*>(memory_) + offset, size);
return result;
} else {
return pread(file_, buffer, size, offset) == (ssize_t)size;
}
}
-bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
+bool MachoWalker::CurrentHeader(struct mach_header_64* header, off_t* offset) {
if (current_header_) {
memcpy(header, current_header_, sizeof(mach_header_64));
*offset = current_header_offset_;
@@ -128,7 +128,7 @@ bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
bool MachoWalker::FindHeader(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype,
- off_t &offset) {
+ off_t& offset) {
// Read the magic bytes that's common amongst all mach-o files
uint32_t magic;
if (!ReadBytes(&magic, sizeof(magic), 0))
@@ -211,7 +211,7 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
// 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.
struct mach_header_64 header64;
- memcpy((void *)&header64, (const void *)&header, sizeof(header));
+ memcpy((void*)&header64, (const void*)&header, sizeof(header));
header64.reserved = 0;
current_header_ = &header64;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.h b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.h
index dd535814a1d..168f30e6465 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/macho_walker.h
@@ -49,12 +49,12 @@ class MachoWalker {
// beginning of the file (not header) where the command was read. If |swap|
// is set, then any command data (other than the returned load_command) should
// be swapped when read
- typedef bool (*LoadCommandCallback)(MachoWalker *walker, load_command *cmd,
- off_t offset, bool swap, void *context);
+ typedef bool (*LoadCommandCallback)(MachoWalker* walker, load_command* cmd,
+ off_t offset, bool swap, void* context);
- MachoWalker(const char *path, LoadCommandCallback callback, void *context);
- MachoWalker(void *memory, size_t size, LoadCommandCallback callback,
- void *context);
+ MachoWalker(const char* path, LoadCommandCallback callback, void* context);
+ MachoWalker(void* memory, size_t size, LoadCommandCallback callback,
+ void* context);
~MachoWalker();
// Begin walking the header for |cpu_type| and |cpu_subtype|. If |cpu_type|
@@ -67,17 +67,17 @@ class MachoWalker {
bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype);
// Read |size| bytes from the opened file at |offset| into |buffer|
- bool ReadBytes(void *buffer, size_t size, off_t offset);
+ bool ReadBytes(void* buffer, size_t size, off_t offset);
// Return the current header and header offset
- bool CurrentHeader(struct mach_header_64 *header, off_t *offset);
+ bool CurrentHeader(struct mach_header_64* header, off_t* offset);
private:
// Locate (if any) the header offset for |cpu_type| and return in |offset|.
// Return true if found, false otherwise.
bool FindHeader(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype,
- off_t &offset);
+ off_t& offset);
// Process an individual header starting at |offset| from the start of the
// file. Return true if successful, false otherwise.
@@ -91,27 +91,27 @@ class MachoWalker {
int file_;
// Memory location to read from.
- void *memory_;
+ void* memory_;
// Size of the memory segment we can read from.
size_t memory_size_;
// User specified callback & context
LoadCommandCallback callback_;
- void *callback_context_;
+ void* callback_context_;
// Current header, size, and offset. The mach_header_64 is used for both
// 32-bit and 64-bit headers because they only differ in their last field
// (reserved). By adding the |current_header_size_| and the
// |current_header_offset_|, you can determine the offset in the file just
// after the header.
- struct mach_header_64 *current_header_;
+ struct mach_header_64* current_header_;
unsigned long current_header_size_;
off_t current_header_offset_;
private:
- MachoWalker(const MachoWalker &);
- MachoWalker &operator=(const MachoWalker &);
+ MachoWalker(const MachoWalker&);
+ MachoWalker& operator=(const MachoWalker&);
};
} // namespace MacFileUtilities
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/minidump_upload.m b/chromium/third_party/breakpad/breakpad/src/common/mac/minidump_upload.m
index 741ad765e5f..1fe4f213f0f 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/minidump_upload.m
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/minidump_upload.m
@@ -40,18 +40,18 @@
#import "common/mac/HTTPMultipartUpload.h"
typedef struct {
- NSString *minidumpPath;
- NSString *uploadURLStr;
- NSString *product;
- NSString *version;
+ NSString* minidumpPath;
+ NSString* uploadURLStr;
+ NSString* product;
+ NSString* version;
BOOL success;
} Options;
//=============================================================================
-static void Start(Options *options) {
- NSURL *url = [NSURL URLWithString:options->uploadURLStr];
- HTTPMultipartUpload *ul = [[HTTPMultipartUpload alloc] initWithURL:url];
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
+static void Start(Options* options) {
+ NSURL* url = [NSURL URLWithString:options->uploadURLStr];
+ HTTPMultipartUpload* ul = [[HTTPMultipartUpload alloc] initWithURL:url];
+ NSMutableDictionary* parameters = [NSMutableDictionary dictionary];
// Add parameters
[parameters setObject:options->product forKey:@"prod"];
@@ -62,9 +62,9 @@ static void Start(Options *options) {
[ul addFileAtPath:options->minidumpPath name:@"upload_file_minidump"];
// Send it
- NSError *error = nil;
- NSData *data = [ul send:&error];
- NSString *result = [[NSString alloc] initWithData:data
+ NSError* error = nil;
+ NSData* data = [ul send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSLog(@"Send: %@", error ? [error description] : @"No Error");
@@ -77,11 +77,12 @@ static void Start(Options *options) {
}
//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
+static void Usage(int argc, const char* argv[]) {
fprintf(stderr, "Submit minidump information.\n");
- fprintf(stderr, "Usage: %s -p <product> -v <version> <minidump> "
- "<upload-URL>\n", argv[0]);
+ fprintf(stderr,
+ "Usage: %s -p <product> -v <version> <minidump> "
+ "<upload-URL>\n",
+ argv[0]);
fprintf(stderr, "<minidump> should be a minidump.\n");
fprintf(stderr, "<upload-URL> is the destination for the upload\n");
@@ -90,12 +91,11 @@ Usage(int argc, const char *argv[]) {
}
//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
+static void SetupOptions(int argc, const char* argv[], Options* options) {
extern int optind;
char ch;
- while ((ch = getopt(argc, (char * const *)argv, "p:v:h?")) != -1) {
+ while ((ch = getopt(argc, (char* const*)argv, "p:v:h?")) != -1) {
switch (ch) {
case 'p':
options->product = [NSString stringWithUTF8String:optarg];
@@ -122,8 +122,8 @@ SetupOptions(int argc, const char *argv[], Options *options) {
}
//=============================================================================
-int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+int main(int argc, const char* argv[]) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
Options options;
bzero(&options, sizeof(Options));
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.cc b/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.cc
index 07c0f42680d..cb155403799 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.cc
@@ -48,12 +48,12 @@ std::string ConvertToString(CFStringRef str) {
CFStringGetBytes(str, CFRangeMake(0, length), kCFStringEncodingUTF8, 0,
false, buffer.get(), maxUTF8Length, &actualUTF8Length);
buffer[actualUTF8Length] = 0;
- result.assign((const char *)buffer.get());
+ result.assign((const char*)buffer.get());
return result;
}
-unsigned int IntegerValueAtIndex(string &str, unsigned int idx) {
+unsigned int IntegerValueAtIndex(string& str, unsigned int idx) {
string digits("0123456789"), temp;
size_t start = 0;
size_t end;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.h b/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.h
index 6d89c834e7c..e87304c18f4 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/string_utilities.h
@@ -45,7 +45,7 @@ string ConvertToString(CFStringRef str);
// Return the idx'th decimal integer in str, separated by non-decimal-digits
// E.g., str = 10.4.8, idx = 1 -> 4
-unsigned int IntegerValueAtIndex(string &str, unsigned int idx);
+unsigned int IntegerValueAtIndex(string& str, unsigned int idx);
} // namespace MacStringUtils
diff --git a/chromium/third_party/breakpad/breakpad/src/common/mac/super_fat_arch.h b/chromium/third_party/breakpad/breakpad/src/common/mac/super_fat_arch.h
index 501c8652a1c..d7fa018aec2 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/mac/super_fat_arch.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/mac/super_fat_arch.h
@@ -57,7 +57,7 @@ class SuperFatArch {
align(0) {
}
- explicit SuperFatArch(const struct fat_arch &arch) :
+ explicit SuperFatArch(const struct fat_arch& arch) :
cputype(arch.cputype),
cpusubtype(arch.cpusubtype),
offset(arch.offset),
diff --git a/chromium/third_party/breakpad/breakpad/src/common/md5.cc b/chromium/third_party/breakpad/breakpad/src/common/md5.cc
index 4f1ac8cad41..b6e710da926 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/md5.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/md5.cc
@@ -31,7 +31,7 @@ static void byteReverse(unsigned char *buf, unsigned longs)
do {
t = (u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
- *(u32 *) buf = t;
+ *(u32*) buf = t;
buf += 4;
} while (--longs);
}
@@ -74,7 +74,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len)
/* Handle any leading odd-sized chunks */
if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
+ unsigned char *p = (unsigned char*) ctx->in + t;
t = 64 - t;
if (len < t) {
@@ -83,7 +83,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len)
}
memcpy(p, buf, t);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
+ MD5Transform(ctx->buf, (u32*) ctx->in);
buf += t;
len -= t;
}
@@ -92,7 +92,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len)
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
+ MD5Transform(ctx->buf, (u32*) ctx->in);
buf += 64;
len -= 64;
}
@@ -127,7 +127,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
+ MD5Transform(ctx->buf, (u32*) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
@@ -141,8 +141,8 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
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);
+ MD5Transform(ctx->buf, (u32*) ctx->in);
+ byteReverse((unsigned char*) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/memory_allocator.h b/chromium/third_party/breakpad/breakpad/src/common/memory_allocator.h
index a3159ea46c8..69055a1582d 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/memory_allocator.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/memory_allocator.h
@@ -71,12 +71,12 @@ class PageAllocator {
FreeAll();
}
- void *Alloc(size_t bytes) {
+ void* Alloc(size_t bytes) {
if (!bytes)
return NULL;
if (current_page_ && page_size_ - page_offset_ >= bytes) {
- uint8_t *const ret = current_page_ + page_offset_;
+ uint8_t* const ret = current_page_ + page_offset_;
page_offset_ += bytes;
if (page_offset_ == page_size_) {
page_offset_ = 0;
@@ -88,7 +88,7 @@ class PageAllocator {
const size_t pages =
(bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_;
- uint8_t *const ret = GetNPages(pages);
+ uint8_t* const ret = GetNPages(pages);
if (!ret)
return NULL;
@@ -115,8 +115,8 @@ class PageAllocator {
unsigned long pages_allocated() { return pages_allocated_; }
private:
- uint8_t *GetNPages(size_t num_pages) {
- void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
+ uint8_t* GetNPages(size_t num_pages) {
+ void* a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (a == MAP_FAILED)
return NULL;
@@ -127,7 +127,7 @@ class PageAllocator {
__msan_unpoison(a, page_size_ * num_pages);
#endif
- struct PageHeader *header = reinterpret_cast<PageHeader*>(a);
+ struct PageHeader* header = reinterpret_cast<PageHeader*>(a);
header->next = last_;
header->num_pages = num_pages;
last_ = header;
@@ -138,22 +138,22 @@ class PageAllocator {
}
void FreeAll() {
- PageHeader *next;
+ PageHeader* next;
- for (PageHeader *cur = last_; cur; cur = next) {
+ for (PageHeader* cur = last_; cur; cur = next) {
next = cur->next;
sys_munmap(cur, cur->num_pages * page_size_);
}
}
struct PageHeader {
- PageHeader *next; // pointer to the start of the next set of pages.
+ PageHeader* next; // pointer to the start of the next set of pages.
size_t num_pages; // the number of pages in this set.
};
const size_t page_size_;
- PageHeader *last_;
- uint8_t *current_page_;
+ PageHeader* last_;
+ uint8_t* current_page_;
size_t page_offset_;
unsigned long pages_allocated_;
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
index 43c86314c64..5803b90d50f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
@@ -46,7 +46,7 @@ TEST(PageAllocatorTest, SmallObjects) {
EXPECT_EQ(0U, allocator.pages_allocated());
for (unsigned i = 1; i < 1024; ++i) {
- uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
+ uint8_t* p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
ASSERT_FALSE(p == NULL);
memset(p, 0, i);
}
@@ -56,11 +56,11 @@ TEST(PageAllocatorTest, LargeObject) {
PageAllocator allocator;
EXPECT_EQ(0U, allocator.pages_allocated());
- uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
+ 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));
+ uint8_t* p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
ASSERT_FALSE(p == NULL);
memset(p, 0, i);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/module.cc b/chromium/third_party/breakpad/breakpad/src/common/module.cc
index aff22127164..f70ae203cfb 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/module.cc
@@ -47,9 +47,9 @@ using std::dec;
using std::hex;
-Module::Module(const string &name, const string &os,
- const string &architecture, const string &id,
- const string &code_id /* = "" */) :
+Module::Module(const string& name, const string& os,
+ const string& architecture, const string& id,
+ const string& code_id /* = "" */) :
name_(name),
os_(os),
architecture_(architecture),
@@ -64,7 +64,7 @@ Module::~Module() {
it != functions_.end(); ++it) {
delete *it;
}
- for (vector<StackFrameEntry *>::iterator it = stack_frame_entries_.begin();
+ for (vector<StackFrameEntry*>::iterator it = stack_frame_entries_.begin();
it != stack_frame_entries_.end(); ++it) {
delete *it;
}
@@ -80,7 +80,7 @@ void Module::SetAddressRanges(const vector<Range>& ranges) {
address_ranges_ = ranges;
}
-void Module::AddFunction(Function *function) {
+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());
@@ -124,13 +124,13 @@ void Module::AddFunction(Function *function) {
}
}
-void Module::AddFunctions(vector<Function *>::iterator begin,
- vector<Function *>::iterator end) {
- for (vector<Function *>::iterator it = begin; it != end; ++it)
+void Module::AddFunctions(vector<Function*>::iterator begin,
+ vector<Function*>::iterator end) {
+ for (vector<Function*>::iterator it = begin; it != end; ++it)
AddFunction(*it);
}
-void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
+void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) {
if (!AddressIsInModule(stack_frame_entry->address)) {
return;
}
@@ -138,7 +138,7 @@ void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
stack_frame_entries_.push_back(stack_frame_entry);
}
-void Module::AddExtern(Extern *ext) {
+void Module::AddExtern(Extern* ext) {
if (!AddressIsInModule(ext->address)) {
return;
}
@@ -151,17 +151,17 @@ void Module::AddExtern(Extern *ext) {
}
}
-void Module::GetFunctions(vector<Function *> *vec,
- vector<Function *>::iterator i) {
+void Module::GetFunctions(vector<Function*>* vec,
+ vector<Function*>::iterator i) {
vec->insert(i, functions_.begin(), functions_.end());
}
-void Module::GetExterns(vector<Extern *> *vec,
- vector<Extern *>::iterator i) {
+void Module::GetExterns(vector<Extern*>* vec,
+ vector<Extern*>::iterator i) {
vec->insert(i, externs_.begin(), externs_.end());
}
-Module::File *Module::FindFile(const string &name) {
+Module::File* Module::FindFile(const string& name) {
// A tricky bit here. The key of each map entry needs to be a
// pointer to the entry's File's name string. This means that we
// can't do the initial lookup with any operation that would create
@@ -175,7 +175,7 @@ Module::File *Module::FindFile(const string &name) {
FileByNameMap::iterator destiny = files_.lower_bound(&name);
if (destiny == files_.end()
|| *destiny->first != name) { // Repeated string comparison, boo hoo.
- File *file = new File(name);
+ File* file = new File(name);
file->source_id = -1;
destiny = files_.insert(destiny,
FileByNameMap::value_type(&file->name, file));
@@ -183,23 +183,23 @@ Module::File *Module::FindFile(const string &name) {
return destiny->second;
}
-Module::File *Module::FindFile(const char *name) {
+Module::File* Module::FindFile(const char* name) {
string name_string = name;
return FindFile(name_string);
}
-Module::File *Module::FindExistingFile(const string &name) {
+Module::File* Module::FindExistingFile(const string& name) {
FileByNameMap::iterator it = files_.find(&name);
return (it == files_.end()) ? NULL : it->second;
}
-void Module::GetFiles(vector<File *> *vec) {
+void Module::GetFiles(vector<File*>* vec) {
vec->clear();
for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it)
vec->push_back(it->second);
}
-void Module::GetStackFrameEntries(vector<StackFrameEntry *> *vec) const {
+void Module::GetStackFrameEntries(vector<StackFrameEntry*>* vec) const {
*vec = stack_frame_entries_;
}
@@ -214,7 +214,7 @@ void Module::AssignSourceIds() {
// info, by setting each one's source id to zero.
for (FunctionSet::const_iterator func_it = functions_.begin();
func_it != functions_.end(); ++func_it) {
- Function *func = *func_it;
+ Function* func = *func_it;
for (vector<Line>::iterator line_it = func->lines.begin();
line_it != func->lines.end(); ++line_it)
line_it->file->source_id = 0;
@@ -238,7 +238,7 @@ bool Module::ReportError() {
return false;
}
-bool Module::WriteRuleMap(const RuleMap &rule_map, std::ostream &stream) {
+bool Module::WriteRuleMap(const RuleMap& rule_map, std::ostream& stream) {
for (RuleMap::const_iterator it = rule_map.begin();
it != rule_map.end(); ++it) {
if (it != rule_map.begin())
@@ -261,7 +261,7 @@ bool Module::AddressIsInModule(Address address) const {
return false;
}
-bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
+bool Module::Write(std::ostream& stream, SymbolData symbol_data) {
stream << "MODULE " << os_ << " " << architecture_ << " "
<< id_ << " " << name_ << "\n";
if (!stream.good())
@@ -277,7 +277,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
// Write out files.
for (FileByNameMap::iterator file_it = files_.begin();
file_it != files_.end(); ++file_it) {
- File *file = file_it->second;
+ File* file = file_it->second;
if (file->source_id >= 0) {
stream << "FILE " << file->source_id << " " << file->name << "\n";
if (!stream.good())
@@ -288,7 +288,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
// Write out functions and their lines.
for (FunctionSet::const_iterator func_it = functions_.begin();
func_it != functions_.end(); ++func_it) {
- Function *func = *func_it;
+ Function* func = *func_it;
vector<Line>::iterator line_it = func->lines.begin();
for (auto range_it = func->ranges.cbegin();
range_it != func->ranges.cend(); ++range_it) {
@@ -322,7 +322,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
// Write out 'PUBLIC' records.
for (ExternSet::const_iterator extern_it = externs_.begin();
extern_it != externs_.end(); ++extern_it) {
- Extern *ext = *extern_it;
+ Extern* ext = *extern_it;
stream << "PUBLIC " << hex
<< (ext->address - load_address_) << " 0 "
<< ext->name << dec << "\n";
@@ -331,10 +331,10 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
if (symbol_data != NO_CFI) {
// Write out 'STACK CFI INIT' and 'STACK CFI' records.
- vector<StackFrameEntry *>::const_iterator frame_it;
+ vector<StackFrameEntry*>::const_iterator frame_it;
for (frame_it = stack_frame_entries_.begin();
frame_it != stack_frame_entries_.end(); ++frame_it) {
- StackFrameEntry *entry = *frame_it;
+ StackFrameEntry* entry = *frame_it;
stream << "STACK CFI INIT " << hex
<< (entry->address - load_address_) << " "
<< entry->size << " " << dec;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/module.h b/chromium/third_party/breakpad/breakpad/src/common/module.h
index 7309cedd219..408e620b266 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/module.h
@@ -39,6 +39,7 @@
#define COMMON_LINUX_MODULE_H__
#include <iostream>
+#include <limits>
#include <map>
#include <set>
#include <string>
@@ -62,6 +63,7 @@ class Module {
public:
// The type of addresses and sizes in a symbol table.
typedef uint64_t Address;
+ static constexpr uint64_t kMaxAddress = std::numeric_limits<Address>::max();
struct File;
struct Function;
struct Line;
@@ -74,7 +76,7 @@ class Module {
// A source file.
struct File {
- explicit File(const string &name_input) : name(name_input), source_id(0) {}
+ explicit File(const string& name_input) : name(name_input), source_id(0) {}
// The name of the source file.
const string name;
@@ -96,12 +98,12 @@ class Module {
// A function.
struct Function {
- Function(const string &name_input, const Address &address_input) :
+ Function(const string& name_input, const Address& address_input) :
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.)
- static bool CompareByAddress(const Function *x, const Function *y) {
+ static bool CompareByAddress(const Function* x, const Function* y) {
return x->address < y->address;
}
@@ -124,18 +126,18 @@ class Module {
struct Line {
// For sorting by address. (Not style-guide compliant, but it's
// stupid not to put this in the struct.)
- static bool CompareByAddress(const Module::Line &x, const Module::Line &y) {
+ static bool CompareByAddress(const Module::Line& x, const Module::Line& y) {
return x.address < y.address;
}
Address address, size; // The address and size of the line's code.
- File *file; // The source file.
+ File* file; // The source file.
int number; // The source line number.
};
// An exported symbol.
struct Extern {
- explicit Extern(const Address &address_input) : address(address_input) {}
+ explicit Extern(const Address& address_input) : address(address_input) {}
const Address address;
string name;
};
@@ -170,8 +172,7 @@ class Module {
};
struct FunctionCompare {
- bool operator() (const Function *lhs,
- const Function *rhs) const {
+ bool operator() (const Function* lhs, const Function* rhs) const {
if (lhs->address == rhs->address)
return lhs->name < rhs->name;
return lhs->address < rhs->address;
@@ -179,16 +180,15 @@ class Module {
};
struct ExternCompare {
- bool operator() (const Extern *lhs,
- const Extern *rhs) const {
+ bool operator() (const Extern* lhs, const Extern* rhs) const {
return lhs->address < rhs->address;
}
};
// 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 &code_id = "");
+ Module(const string& name, const string& os, const string& architecture,
+ const string& id, const string& code_id = "");
~Module();
// Set the module's load address to LOAD_ADDRESS; addresses given
@@ -216,62 +216,62 @@ class Module {
// 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.
- void AddFunction(Function *function);
+ void AddFunction(Function* function);
// Add all the functions in [BEGIN,END) to the module.
// This module owns all Function objects added with this function:
// destroying the module destroys them as well.
- void AddFunctions(vector<Function *>::iterator begin,
- vector<Function *>::iterator end);
+ void AddFunctions(vector<Function*>::iterator begin,
+ vector<Function*>::iterator end);
// Add STACK_FRAME_ENTRY to the module.
// This module owns all StackFrameEntry objects added with this
// function: destroying the module destroys them as well.
- void AddStackFrameEntry(StackFrameEntry *stack_frame_entry);
+ void AddStackFrameEntry(StackFrameEntry* stack_frame_entry);
// Add PUBLIC to the module.
// This module owns all Extern objects added with this function:
// destroying the module destroys them as well.
- void AddExtern(Extern *ext);
+ void AddExtern(Extern* ext);
// If this module has a file named NAME, return a pointer to it. If
// it has none, then create one and return a pointer to the new
// file. This module owns all File objects created using these
// functions; destroying the module destroys them as well.
- File *FindFile(const string &name);
- File *FindFile(const char *name);
+ File* FindFile(const string& name);
+ File* FindFile(const char* name);
// If this module has a file named NAME, return a pointer to it.
// Otherwise, return NULL.
- File *FindExistingFile(const string &name);
+ File* FindExistingFile(const string& name);
// Insert pointers to the functions added to this module at I in
// VEC. The pointed-to Functions are still owned by this module.
// (Since this is effectively a copy of the function list, this is
// mostly useful for testing; other uses should probably get a more
// appropriate interface.)
- void GetFunctions(vector<Function *> *vec, vector<Function *>::iterator i);
+ void GetFunctions(vector<Function*>* vec, vector<Function*>::iterator i);
// Insert pointers to the externs added to this module at I in
// VEC. The pointed-to Externs are still owned by this module.
// (Since this is effectively a copy of the extern list, this is
// mostly useful for testing; other uses should probably get a more
// appropriate interface.)
- void GetExterns(vector<Extern *> *vec, vector<Extern *>::iterator i);
+ void GetExterns(vector<Extern*>* vec, vector<Extern*>::iterator i);
// Clear VEC and fill it with pointers to the Files added to this
// module, sorted by name. The pointed-to Files are still owned by
// this module. (Since this is effectively a copy of the file list,
// this is mostly useful for testing; other uses should probably get
// a more appropriate interface.)
- void GetFiles(vector<File *> *vec);
+ void GetFiles(vector<File*>* vec);
// Clear VEC and fill it with pointers to the StackFrameEntry
// objects that have been added to this module. (Since this is
// effectively a copy of the stack frame entry list, this is mostly
// useful for testing; other uses should probably get
// a more appropriate interface.)
- void GetStackFrameEntries(vector<StackFrameEntry *> *vec) const;
+ void GetStackFrameEntries(vector<StackFrameEntry*>* vec) const;
// Find those files in this module that are actually referred to by
// functions' line number data, and assign them source id numbers.
@@ -292,7 +292,7 @@ class Module {
// - all CFI records.
// Addresses in the output are all relative to the load address
// established by SetLoadAddress.
- bool Write(std::ostream &stream, SymbolData symbol_data);
+ bool Write(std::ostream& stream, SymbolData symbol_data);
string name() const { return name_; }
string os() const { return os_; }
@@ -308,7 +308,7 @@ class Module {
// Write RULE_MAP to STREAM, in the form appropriate for 'STACK CFI'
// records, without a final newline. Return true if all goes well;
// if an error occurs, return false, and leave errno set.
- static bool WriteRuleMap(const RuleMap &rule_map, std::ostream &stream);
+ 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.
@@ -329,18 +329,18 @@ class Module {
// Relation for maps whose keys are strings shared with some other
// structure.
struct CompareStringPtrs {
- bool operator()(const string *x, const string *y) const { return *x < *y; }
+ bool operator()(const string* x, const string* y) const { return *x < *y; }
};
// A map from filenames to File structures. The map's keys are
// pointers to the Files' names.
- typedef map<const string *, File *, CompareStringPtrs> FileByNameMap;
+ typedef map<const string*, File*, CompareStringPtrs> FileByNameMap;
// A set containing Function structures, sorted by address.
- typedef set<Function *, FunctionCompare> FunctionSet;
+ typedef set<Function*, FunctionCompare> FunctionSet;
// A set containing Extern structures, sorted by address.
- typedef set<Extern *, ExternCompare> ExternSet;
+ typedef set<Extern*, ExternCompare> ExternSet;
// The module owns all the files and functions that have been added
// to it; destroying the module frees the Files and Functions these
@@ -350,7 +350,7 @@ class Module {
// The module owns all the call frame info entries that have been
// added to it.
- vector<StackFrameEntry *> stack_frame_entries_;
+ vector<StackFrameEntry*> stack_frame_entries_;
// The module owns all the externs that have been added to it;
// destroying the module frees the Externs these point to.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/module_unittest.cc
index 37fee5dd69c..cede09c31f1 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/module_unittest.cc
@@ -49,7 +49,7 @@ using std::stringstream;
using std::vector;
using testing::ContainerEq;
-static Module::Function* generate_duplicate_function(const string &name) {
+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;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.cc b/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.cc
index 168d0b2879d..9524a18b57c 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.cc
@@ -97,7 +97,7 @@ struct LineInfo {
// Information of a function.
struct FuncInfo {
// Name of the function.
- const char *name;
+ const char* name;
// Offset from the base of the loading address.
GElf_Off rva_to_base;
// Virtual address of the function.
@@ -115,7 +115,7 @@ struct FuncInfo {
// Information of a source file.
struct SourceFileInfo {
// Name of the source file.
- const char *name;
+ const char* name;
// Starting address of the source file.
GElf_Addr addr;
// Id of the source file.
@@ -125,12 +125,12 @@ struct SourceFileInfo {
};
struct CompareString {
- bool operator()(const char *s1, const char *s2) const {
+ bool operator()(const char* s1, const char* s2) const {
return strcmp(s1, s2) < 0;
}
};
-typedef std::map<const char *, struct SymbolEntry *, CompareString> SymbolMap;
+typedef std::map<const char*, struct SymbolEntry*, CompareString> SymbolMap;
// Information of a symbol table.
// This is the root of all types of symbol.
@@ -141,16 +141,16 @@ struct SymbolInfo {
};
// Stab section name.
-const char *kStabName = ".stab";
+const char* kStabName = ".stab";
// Stab str section name.
-const char *kStabStrName = ".stabstr";
+const char* kStabStrName = ".stabstr";
// Symtab section name.
-const char *kSymtabName = ".symtab";
+const char* kSymtabName = ".symtab";
// Strtab section name.
-const char *kStrtabName = ".strtab";
+const char* kStrtabName = ".strtab";
// Default buffer lenght for demangle.
const int demangleLen = 20000;
@@ -160,11 +160,11 @@ uint64_t stringOffset = 0;
// Update the offset to the start of the string index of the next
// object module for every N_ENDM stabs.
-inline void RecalculateOffset(struct slist* cur_list, char *stabstr) {
+inline void RecalculateOffset(struct slist* cur_list, char* stabstr) {
while ((--cur_list)->n_strx == 0) ;
stringOffset += cur_list->n_strx;
- char *temp = stabstr + stringOffset;
+ char* temp = stabstr + stringOffset;
while (*temp != '\0') {
++stringOffset;
++temp;
@@ -174,10 +174,10 @@ inline void RecalculateOffset(struct slist* cur_list, char *stabstr) {
}
// Demangle using demangle library on Solaris.
-std::string Demangle(const char *mangled) {
+std::string Demangle(const char* mangled) {
int status = 0;
std::string str(mangled);
- char *demangled = (char *)malloc(demangleLen);
+ char* demangled = (char*)malloc(demangleLen);
if (!demangled) {
fprintf(stderr, "no enough memory.\n");
@@ -197,7 +197,7 @@ out:
return str;
}
-bool WriteFormat(int fd, const char *fmt, ...) {
+bool WriteFormat(int fd, const char* fmt, ...) {
va_list list;
char buffer[4096];
ssize_t expected, written;
@@ -209,27 +209,27 @@ bool WriteFormat(int fd, const char *fmt, ...) {
return expected == written;
}
-bool IsValidElf(const GElf_Ehdr *elf_header) {
+bool IsValidElf(const GElf_Ehdr* elf_header) {
return memcmp(elf_header, ELFMAG, SELFMAG) == 0;
}
-static bool FindSectionByName(Elf *elf, const char *name,
+static bool FindSectionByName(Elf* elf, const char* name,
int shstrndx,
- GElf_Shdr *shdr) {
+ GElf_Shdr* shdr) {
assert(name != NULL);
if (strlen(name) == 0)
return false;
- Elf_Scn *scn = NULL;
+ Elf_Scn* scn = NULL;
while ((scn = elf_nextscn(elf, scn)) != NULL) {
- if (gelf_getshdr(scn, shdr) == (GElf_Shdr *)0) {
+ if (gelf_getshdr(scn, shdr) == (GElf_Shdr*)0) {
fprintf(stderr, "failed to read section header: %s\n", elf_errmsg(0));
return false;
}
- const char *section_name = elf_strptr(elf, shstrndx, shdr->sh_name);
+ const char* section_name = elf_strptr(elf, shstrndx, shdr->sh_name);
if (!section_name) {
fprintf(stderr, "Section name error: %s\n", elf_errmsg(-1));
continue;
@@ -245,10 +245,10 @@ static bool FindSectionByName(Elf *elf, const char *name,
// The parameter size is used for FPO-optimized code, and
// this is all tied up with the debugging data for Windows x86.
// Set it to 0 on Solaris.
-int LoadStackParamSize(struct slist *list,
- struct slist *list_end,
- struct FuncInfo *func_info) {
- struct slist *cur_list = list;
+int LoadStackParamSize(struct slist* list,
+ struct slist* list_end,
+ struct FuncInfo* func_info) {
+ struct slist* cur_list = list;
int step = 1;
while (cur_list < list_end && cur_list->n_type == N_PSYM) {
++cur_list;
@@ -259,10 +259,10 @@ int LoadStackParamSize(struct slist *list,
return step;
}
-int LoadLineInfo(struct slist *list,
- struct slist *list_end,
- struct FuncInfo *func_info) {
- struct slist *cur_list = list;
+int LoadLineInfo(struct slist* list,
+ struct slist* list_end,
+ struct FuncInfo* func_info) {
+ struct slist* cur_list = list;
do {
// Skip non line information.
while (cur_list < list_end && cur_list->n_type != N_SLINE) {
@@ -288,12 +288,12 @@ int LoadLineInfo(struct slist *list,
return cur_list - list;
}
-int LoadFuncSymbols(struct slist *list,
- struct slist *list_end,
- char *stabstr,
+int LoadFuncSymbols(struct slist* list,
+ struct slist* list_end,
+ char* stabstr,
GElf_Word base,
- struct SourceFileInfo *source_file_info) {
- struct slist *cur_list = list;
+ struct SourceFileInfo* source_file_info) {
+ struct slist* cur_list = list;
assert(cur_list->n_type == N_SO);
++cur_list;
@@ -342,17 +342,17 @@ int LoadFuncSymbols(struct slist *list,
}
// Compute size and rva information based on symbols loaded from stab section.
-bool ComputeSizeAndRVA(struct SymbolInfo *symbols) {
- std::vector<struct SourceFileInfo> *sorted_files =
+bool ComputeSizeAndRVA(struct SymbolInfo* symbols) {
+ std::vector<struct SourceFileInfo>* sorted_files =
&(symbols->source_file_info);
- SymbolMap *symbol_entries = &(symbols->symbol_entries);
+ SymbolMap* symbol_entries = &(symbols->symbol_entries);
for (size_t i = 0; i < sorted_files->size(); ++i) {
- struct SourceFileInfo &source_file = (*sorted_files)[i];
- std::vector<struct FuncInfo> *sorted_functions = &(source_file.func_info);
+ struct SourceFileInfo& source_file = (*sorted_files)[i];
+ std::vector<struct FuncInfo>* sorted_functions = &(source_file.func_info);
int func_size = sorted_functions->size();
for (size_t j = 0; j < func_size; ++j) {
- struct FuncInfo &func_info = (*sorted_functions)[j];
+ struct FuncInfo& func_info = (*sorted_functions)[j];
int line_count = func_info.line_info.size();
// Discard the ending part of the name.
@@ -373,13 +373,13 @@ bool ComputeSizeAndRVA(struct SymbolInfo *symbols) {
// Compute function and line size.
for (size_t k = 0; k < line_count; ++k) {
- struct LineInfo &line_info = func_info.line_info[k];
+ struct LineInfo& line_info = func_info.line_info[k];
line_info.rva_to_base = line_info.rva_to_func + func_info.rva_to_base;
if (k == line_count - 1) {
line_info.size = func_info.size - line_info.rva_to_func;
} else {
- struct LineInfo &next_line = func_info.line_info[k + 1];
+ struct LineInfo& next_line = func_info.line_info[k + 1];
line_info.size = next_line.rva_to_func - line_info.rva_to_func;
}
} // for each line.
@@ -392,24 +392,23 @@ bool ComputeSizeAndRVA(struct SymbolInfo *symbols) {
return true;
}
-bool LoadAllSymbols(const GElf_Shdr *stab_section,
- const GElf_Shdr *stabstr_section,
+bool LoadAllSymbols(const GElf_Shdr* stab_section,
+ const GElf_Shdr* stabstr_section,
GElf_Word base,
- struct SymbolInfo *symbols) {
+ struct SymbolInfo* symbols) {
if (stab_section == NULL || stabstr_section == NULL)
return false;
- char *stabstr =
- reinterpret_cast<char *>(stabstr_section->sh_offset + base);
- struct slist *lists =
- reinterpret_cast<struct slist *>(stab_section->sh_offset + base);
+ char* stabstr = reinterpret_cast<char*>(stabstr_section->sh_offset + base);
+ struct slist* lists =
+ reinterpret_cast<struct slist*>(stab_section->sh_offset + base);
int nstab = stab_section->sh_size / sizeof(struct slist);
int source_id = 0;
// First pass, load all symbols from the object file.
for (int i = 0; i < nstab; ) {
int step = 1;
- struct slist *cur_list = lists + i;
+ struct slist* cur_list = lists + i;
if (cur_list->n_type == N_SO) {
// FUNC <address> <size> <param_stack_size> <function>
struct SourceFileInfo source_file_info;
@@ -431,12 +430,12 @@ bool LoadAllSymbols(const GElf_Shdr *stab_section,
return ComputeSizeAndRVA(symbols);
}
-bool LoadSymbols(Elf *elf, GElf_Ehdr *elf_header, struct SymbolInfo *symbols,
- void *obj_base) {
+bool LoadSymbols(Elf* elf, GElf_Ehdr* elf_header, struct SymbolInfo* symbols,
+ void* obj_base) {
GElf_Word base = reinterpret_cast<GElf_Word>(obj_base);
- const GElf_Shdr *sections =
- reinterpret_cast<GElf_Shdr *>(elf_header->e_shoff + base);
+ const GElf_Shdr* sections =
+ reinterpret_cast<GElf_Shdr*>(elf_header->e_shoff + base);
GElf_Shdr stab_section;
if (!FindSectionByName(elf, kStabName, elf_header->e_shstrndx,
&stab_section)) {
@@ -462,11 +461,11 @@ bool LoadSymbols(Elf *elf, GElf_Ehdr *elf_header, struct SymbolInfo *symbols,
return false;
}
- Elf_Sym *symbol = (Elf_Sym *)((char *)base + symtab_section.sh_offset);
+ Elf_Sym* symbol = (Elf_Sym*)((char*)base + symtab_section.sh_offset);
for (int i = 0; i < symtab_section.sh_size/symtab_section.sh_entsize; ++i) {
- struct SymbolEntry *symbol_entry =
- (struct SymbolEntry *)malloc(sizeof(struct SymbolEntry));
- const char *name = reinterpret_cast<char *>(
+ struct SymbolEntry* symbol_entry =
+ (struct SymbolEntry*)malloc(sizeof(struct SymbolEntry));
+ const char* name = reinterpret_cast<char*>(
strtab_section.sh_offset + (GElf_Word)base + symbol->st_name);
symbol_entry->offset = symbol->st_value;
symbol_entry->size = symbol->st_size;
@@ -479,8 +478,8 @@ bool LoadSymbols(Elf *elf, GElf_Ehdr *elf_header, struct SymbolInfo *symbols,
return LoadAllSymbols(&stab_section, &stabstr_section, base, symbols);
}
-bool WriteModuleInfo(int fd, GElf_Half arch, const std::string &obj_file) {
- const char *arch_name = NULL;
+bool WriteModuleInfo(int fd, GElf_Half arch, const std::string& obj_file) {
+ const char* arch_name = NULL;
if (arch == EM_386)
arch_name = "x86";
else if (arch == EM_X86_64)
@@ -508,10 +507,10 @@ bool WriteModuleInfo(int fd, GElf_Half arch, const std::string &obj_file) {
return false;
}
-bool WriteSourceFileInfo(int fd, const struct SymbolInfo &symbols) {
+bool WriteSourceFileInfo(int fd, const struct SymbolInfo& symbols) {
for (size_t i = 0; i < symbols.source_file_info.size(); ++i) {
if (symbols.source_file_info[i].source_id != -1) {
- const char *name = symbols.source_file_info[i].name;
+ const char* name = symbols.source_file_info[i].name;
if (!WriteFormat(fd, "FILE %d %s\n",
symbols.source_file_info[i].source_id, name))
return false;
@@ -521,7 +520,7 @@ bool WriteSourceFileInfo(int fd, const struct SymbolInfo &symbols) {
}
bool WriteOneFunction(int fd, int source_id,
- const struct FuncInfo &func_info){
+ const struct FuncInfo& func_info){
// Discard the ending part of the name.
std::string func_name(func_info.name);
std::string::size_type last_colon = func_name.find_last_of(':');
@@ -539,7 +538,7 @@ bool WriteOneFunction(int fd, int source_id,
func_info.stack_param_size,
func_name.c_str())) {
for (size_t i = 0; i < func_info.line_info.size(); ++i) {
- const struct LineInfo &line_info = func_info.line_info[i];
+ const struct LineInfo& line_info = func_info.line_info[i];
if (line_info.line_num == 0)
return true;
if (!WriteFormat(fd, "%llx %x %d %d\n",
@@ -554,11 +553,11 @@ bool WriteOneFunction(int fd, int source_id,
return false;
}
-bool WriteFunctionInfo(int fd, const struct SymbolInfo &symbols) {
+bool WriteFunctionInfo(int fd, const struct SymbolInfo& symbols) {
for (size_t i = 0; i < symbols.source_file_info.size(); ++i) {
- const struct SourceFileInfo &file_info = symbols.source_file_info[i];
+ const struct SourceFileInfo& file_info = symbols.source_file_info[i];
for (size_t j = 0; j < file_info.func_info.size(); ++j) {
- const struct FuncInfo &func_info = file_info.func_info[j];
+ const struct FuncInfo& func_info = file_info.func_info[j];
if (!WriteOneFunction(fd, file_info.source_id, func_info))
return false;
}
@@ -566,7 +565,7 @@ bool WriteFunctionInfo(int fd, const struct SymbolInfo &symbols) {
return true;
}
-bool DumpStabSymbols(int fd, const struct SymbolInfo &symbols) {
+bool DumpStabSymbols(int fd, const struct SymbolInfo& symbols) {
return WriteSourceFileInfo(fd, symbols) &&
WriteFunctionInfo(fd, symbols);
}
@@ -604,13 +603,13 @@ class FDWrapper {
//
class MmapWrapper {
public:
- MmapWrapper(void *mapped_address, size_t mapped_size) :
+ MmapWrapper(void* mapped_address, size_t mapped_size) :
base_(mapped_address), size_(mapped_size) {
}
~MmapWrapper() {
if (base_ != NULL) {
assert(size_ > 0);
- munmap((char *)base_, size_);
+ munmap((char*)base_, size_);
}
}
void release() {
@@ -619,7 +618,7 @@ class MmapWrapper {
}
private:
- void *base_;
+ void* base_;
size_t size_;
};
@@ -629,14 +628,14 @@ namespace google_breakpad {
class AutoElfEnder {
public:
- AutoElfEnder(Elf *elf) : elf_(elf) {}
+ AutoElfEnder(Elf* elf) : elf_(elf) {}
~AutoElfEnder() { if (elf_) elf_end(elf_); }
private:
- Elf *elf_;
+ Elf* elf_;
};
-bool DumpSymbols::WriteSymbolFile(const std::string &obj_file, int sym_fd) {
+bool DumpSymbols::WriteSymbolFile(const std::string& obj_file, int sym_fd) {
if (elf_version(EV_CURRENT) == EV_NONE) {
fprintf(stderr, "elf_version() failed: %s\n", elf_errmsg(0));
return false;
@@ -649,16 +648,16 @@ bool DumpSymbols::WriteSymbolFile(const std::string &obj_file, int sym_fd) {
struct stat st;
if (fstat(obj_fd, &st) != 0 && st.st_size <= 0)
return false;
- void *obj_base = mmap(NULL, st.st_size,
+ void* obj_base = mmap(NULL, st.st_size,
PROT_READ, MAP_PRIVATE, obj_fd, 0);
if (obj_base == MAP_FAILED)
return false;
MmapWrapper map_wrapper(obj_base, st.st_size);
GElf_Ehdr elf_header;
- Elf *elf = elf_begin(obj_fd, ELF_C_READ, NULL);
+ Elf* elf = elf_begin(obj_fd, ELF_C_READ, NULL);
AutoElfEnder elfEnder(elf);
- if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr *)NULL) {
+ if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr*)NULL) {
fprintf(stderr, "failed to read elf header: %s\n", elf_errmsg(-1));
return false;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.h b/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.h
index 7f4baadcfca..3bca8a235ca 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/solaris/dump_symbols.h
@@ -40,7 +40,7 @@ namespace google_breakpad {
class DumpSymbols {
public:
- bool WriteSymbolFile(const std::string &obj_file,
+ bool WriteSymbolFile(const std::string& obj_file,
int sym_fd);
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/solaris/file_id.cc b/chromium/third_party/breakpad/breakpad/src/common/solaris/file_id.cc
index 643a14629d5..c32c73bb047 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/solaris/file_id.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/solaris/file_id.cc
@@ -54,17 +54,17 @@ namespace google_breakpad {
class AutoElfEnder {
public:
- AutoElfEnder(Elf *elf) : elf_(elf) {}
+ AutoElfEnder(Elf* elf) : elf_(elf) {}
~AutoElfEnder() { if (elf_) elf_end(elf_); }
private:
- Elf *elf_;
+ Elf* elf_;
};
// Find the text section in elf object file.
// Return the section start address and the size.
-static bool FindElfTextSection(int fd, const void *elf_base,
- const void **text_start,
- int *text_size) {
+static bool FindElfTextSection(int fd, const void* elf_base,
+ const void** text_start,
+ int* text_size) {
assert(text_start);
assert(text_size);
@@ -78,10 +78,10 @@ static bool FindElfTextSection(int fd, const void *elf_base,
GElf_Ehdr elf_header;
lseek(fd, 0L, 0);
- Elf *elf = elf_begin(fd, ELF_C_READ, NULL);
+ Elf* elf = elf_begin(fd, ELF_C_READ, NULL);
AutoElfEnder elfEnder(elf);
- if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr *)NULL) {
+ if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr*)NULL) {
print_message2(2, "failed to read elf header: %s\n", elf_errmsg(-1));
return false;
}
@@ -95,18 +95,18 @@ static bool FindElfTextSection(int fd, const void *elf_base,
}
static const char kTextSectionName[] = ".text";
- const GElf_Shdr *text_section = NULL;
- Elf_Scn *scn = NULL;
+ const GElf_Shdr* text_section = NULL;
+ Elf_Scn* scn = NULL;
GElf_Shdr shdr;
while ((scn = elf_nextscn(elf, scn)) != NULL) {
- if (gelf_getshdr(scn, &shdr) == (GElf_Shdr *)0) {
+ if (gelf_getshdr(scn, &shdr) == (GElf_Shdr*)0) {
print_message2(2, "failed to read section header: %s\n", elf_errmsg(0));
return false;
}
if (shdr.sh_type == SHT_PROGBITS) {
- const char *section_name = elf_strptr(elf, elf_header.e_shstrndx,
+ const char* section_name = elf_strptr(elf, elf_header.e_shstrndx,
shdr.sh_name);
if (!section_name) {
print_message2(2, "Section name error: %s\n", elf_errmsg(-1));
@@ -120,7 +120,7 @@ static bool FindElfTextSection(int fd, const void *elf_base,
}
}
if (text_section != NULL && text_section->sh_size > 0) {
- *text_start = (char *)elf_base + text_section->sh_offset;
+ *text_start = (char*)elf_base + text_section->sh_offset;
*text_size = text_section->sh_size;
return true;
}
@@ -128,7 +128,7 @@ static bool FindElfTextSection(int fd, const void *elf_base,
return false;
}
-FileID::FileID(const char *path) {
+FileID::FileID(const char* path) {
strcpy(path_, path);
}
@@ -150,29 +150,29 @@ bool FileID::ElfFileIdentifier(unsigned char identifier[16]) {
if (fstat(fd, &st) != 0 || st.st_size <= 0)
return false;
- void *base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ void* base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (base == MAP_FAILED)
return false;
bool success = false;
- const void *text_section = NULL;
+ const void* text_section = NULL;
int text_size = 0;
if (FindElfTextSection(fd, base, &text_section, &text_size)) {
MD5Context md5;
MD5Init(&md5);
- MD5Update(&md5, (const unsigned char *)text_section, text_size);
+ MD5Update(&md5, (const unsigned char*)text_section, text_size);
MD5Final(identifier, &md5);
success = true;
}
- munmap((char *)base, st.st_size);
+ munmap((char*)base, st.st_size);
return success;
}
// static
bool FileID::ConvertIdentifierToString(const unsigned char identifier[16],
- char *buffer, int buffer_length) {
+ char* buffer, int buffer_length) {
if (buffer_length < 34)
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/solaris/guid_creator.cc b/chromium/third_party/breakpad/breakpad/src/common/solaris/guid_creator.cc
index e9e6c6f5d2b..17d773e722f 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/solaris/guid_creator.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/solaris/guid_creator.cc
@@ -74,8 +74,8 @@ bool GUIDToString(const GUID *guid, char *buf, int buf_len) {
assert(buf_len > kGUIDStringLength);
int num = snprintf(buf, buf_len, kGUIDFormatString,
guid->data1, guid->data2, guid->data3,
- *reinterpret_cast<const uint32_t *>(&(guid->data4[0])),
- *reinterpret_cast<const uint32_t *>(&(guid->data4[4])));
+ *reinterpret_cast<const uint32_t*>(&(guid->data4[0])),
+ *reinterpret_cast<const uint32_t*>(&(guid->data4[4])));
if (num != kGUIDStringLength)
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.cc b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.cc
index 6019fc7ee23..43c404029a8 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.cc
@@ -45,7 +45,7 @@ using std::vector;
namespace google_breakpad {
-StabsReader::EntryIterator::EntryIterator(const ByteBuffer *buffer,
+StabsReader::EntryIterator::EntryIterator(const ByteBuffer* buffer,
bool big_endian, size_t value_size)
: value_size_(value_size), cursor_(buffer, big_endian) {
// Actually, we could handle weird sizes just fine, but they're
@@ -65,10 +65,10 @@ void StabsReader::EntryIterator::Fetch() {
entry_.at_end = !cursor_;
}
-StabsReader::StabsReader(const uint8_t *stab, size_t stab_size,
- const uint8_t *stabstr, size_t stabstr_size,
+StabsReader::StabsReader(const uint8_t* stab, size_t stab_size,
+ const uint8_t* stabstr, size_t stabstr_size,
bool big_endian, size_t value_size, bool unitized,
- StabsHandler *handler)
+ StabsHandler* handler)
: entries_(stab, stab_size),
strings_(stabstr, stabstr_size),
iterator_(&entries_, big_endian, value_size),
@@ -78,7 +78,7 @@ StabsReader::StabsReader(const uint8_t *stab, size_t stab_size,
next_cu_string_offset_(0),
current_source_file_(NULL) { }
-const char *StabsReader::SymbolString() {
+const char* StabsReader::SymbolString() {
ptrdiff_t offset = string_offset_ + iterator_->name_offset;
if (offset < 0 || (size_t) offset >= strings_.Size()) {
handler_->Warning("symbol %d: name offset outside the string section\n",
@@ -87,7 +87,7 @@ const char *StabsReader::SymbolString() {
// taken from the string section.
offset = 0;
}
- return reinterpret_cast<const char *>(strings_.start + offset);
+ return reinterpret_cast<const char*>(strings_.start + offset);
}
bool StabsReader::Process() {
@@ -134,9 +134,9 @@ bool StabsReader::ProcessCompilationUnit() {
// There may be an N_SO entry whose name ends with a slash,
// indicating the directory in which the compilation occurred.
// The build directory defaults to NULL.
- const char *build_directory = NULL;
+ const char* build_directory = NULL;
{
- const char *name = SymbolString();
+ const char* name = SymbolString();
if (name[0] && name[strlen(name) - 1] == '/') {
build_directory = name;
++iterator_;
@@ -148,7 +148,7 @@ bool StabsReader::ProcessCompilationUnit() {
{
if (iterator_->at_end || iterator_->type != N_SO)
return true;
- const char *name = SymbolString();
+ const char* name = SymbolString();
if (name[0] == '\0') {
// This seems to be a stray end-of-compilation-unit marker;
// consume it, but don't report the end, since we didn't see a
@@ -203,7 +203,7 @@ bool StabsReader::ProcessCompilationUnit() {
uint64_t ending_address = 0;
if (!iterator_->at_end) {
assert(iterator_->type == N_SO);
- const char *name = SymbolString();
+ const char* name = SymbolString();
if (name[0] == '\0') {
ending_address = iterator_->value;
++iterator_;
@@ -225,8 +225,8 @@ bool StabsReader::ProcessFunction() {
// The STABS string for an N_FUN entry is the name of the function,
// followed by a colon, followed by type information for the
// function. We want to pass the name alone to StartFunction.
- const char *stab_string = SymbolString();
- const char *name_end = strchr(stab_string, ':');
+ const char* stab_string = SymbolString();
+ const char* name_end = strchr(stab_string, ':');
if (! name_end)
name_end = stab_string + strlen(stab_string);
string name(stab_string, name_end - stab_string);
@@ -270,7 +270,7 @@ bool StabsReader::ProcessFunction() {
if (!iterator_->at_end) {
assert(iterator_->type == N_SO || iterator_->type == N_FUN);
if (iterator_->type == N_FUN) {
- const char *symbol_name = SymbolString();
+ const char* symbol_name = SymbolString();
if (symbol_name[0] == '\0') {
// An N_FUN entry with no name is a terminator for this function;
// its value is the function's size.
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.h b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.h
index 98ee2dd53b4..1e773f45ddf 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader.h
@@ -92,10 +92,10 @@ class StabsReader {
//
// Note that, in ELF, the .stabstr section should be found using the
// 'sh_link' field of the .stab section header, not by name.
- StabsReader(const uint8_t *stab, size_t stab_size,
- const uint8_t *stabstr, size_t stabstr_size,
+ StabsReader(const uint8_t* stab, size_t stab_size,
+ const uint8_t* stabstr, size_t stabstr_size,
bool big_endian, size_t value_size, bool unitized,
- StabsHandler *handler);
+ StabsHandler* handler);
// Process the STABS data, calling the handler's member functions to
// report what we find. While the handler functions return true,
@@ -149,17 +149,17 @@ class StabsReader {
// Mac, they are 32 or 64 bits long. Oddly, the section header's entry
// size for a Linux ELF .stab section varies according to the ELF class
// from 12 to 20 even as the actual entries remain unchanged.
- EntryIterator(const ByteBuffer *buffer, bool big_endian, size_t value_size);
+ EntryIterator(const ByteBuffer* buffer, bool big_endian, size_t value_size);
// Move to the next entry. This function's behavior is undefined if
// at_end() is true when it is called.
- EntryIterator &operator++() { Fetch(); entry_.index++; return *this; }
+ EntryIterator& operator++() { Fetch(); entry_.index++; return *this; }
// Dereferencing this iterator produces a reference to an Entry structure
// that holds the current entry's values. The entry is owned by this
// EntryIterator, and will be invalidated at the next call to operator++.
- const Entry &operator*() const { return entry_; }
- const Entry *operator->() const { return &entry_; }
+ const Entry& operator*() const { return entry_; }
+ const Entry* operator->() const { return &entry_; }
private:
// Read the STABS entry at cursor_, and set entry_ appropriately.
@@ -178,12 +178,12 @@ class StabsReader {
// A source line, saved to be reported later.
struct Line {
uint64_t address;
- const char *filename;
+ const char* filename;
int number;
};
// Return the name of the current symbol.
- const char *SymbolString();
+ const char* SymbolString();
// Process a compilation unit starting at symbol_. Return true
// to continue processing, or false to abort.
@@ -210,7 +210,7 @@ class StabsReader {
// StabsReader::StabsReader.
bool unitized_;
- StabsHandler *handler_;
+ StabsHandler* handler_;
// The offset of the current compilation unit's strings within stabstr_.
size_t string_offset_;
@@ -220,7 +220,7 @@ class StabsReader {
size_t next_cu_string_offset_;
// The current source file name.
- const char *current_source_file_;
+ const char* current_source_file_;
// Mac OS X STABS place SLINE records before functions; we accumulate a
// vector of these until we see the FUN record, and then report them
@@ -261,7 +261,7 @@ class StabsHandler {
// FILENAME values are different addresses, they represent different
// file names.
//
- // Thus, it's safe to use (say) std::map<char *, ...>, which does
+ // Thus, it's safe to use (say) std::map<char*, ...>, which does
// string address comparisons, not string content comparisons.
// Since all the strings are in same array of characters --- the
// .stabstr section --- comparing their addresses produces
@@ -271,8 +271,8 @@ class StabsHandler {
// named FILENAME, and whose base address is ADDRESS. If
// BUILD_DIRECTORY is non-NULL, it is the name of the build
// directory in which the compilation occurred.
- virtual bool StartCompilationUnit(const char *filename, uint64_t address,
- const char *build_directory) {
+ virtual bool StartCompilationUnit(const char* filename, uint64_t address,
+ const char* build_directory) {
return true;
}
@@ -292,7 +292,7 @@ class StabsHandler {
// StartFunction is the function name alone.
//
// In languages that use name mangling, like C++, NAME is mangled.
- virtual bool StartFunction(const string &name, uint64_t address) {
+ virtual bool StartFunction(const string& name, uint64_t address) {
return true;
}
@@ -305,19 +305,19 @@ class StabsHandler {
// Report that the code at ADDRESS is attributable to line NUMBER of
// the source file named FILENAME. The caller must infer the ending
// address of the line.
- virtual bool Line(uint64_t address, const char *filename, int number) {
+ virtual bool Line(uint64_t address, const char* filename, int number) {
return true;
}
// Report that an exported function NAME is present at ADDRESS.
// The size of the function is unknown.
- virtual bool Extern(const string &name, uint64_t address) {
+ virtual bool Extern(const string& name, uint64_t address) {
return true;
}
// Report a warning. FORMAT is a printf-like format string,
// specifying how to format the subsequent arguments.
- virtual void Warning(const char *format, ...) = 0;
+ virtual void Warning(const char* format, ...) = 0;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader_unittest.cc
index a84da1c4cac..24f3e1a57b1 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_reader_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_reader_unittest.cc
@@ -75,7 +75,7 @@ class StringAssembler: public Section {
// Add the string S to this StringAssembler, and return the string's
// offset within this compilation unit's strings. If S has been added
// already, this returns the offset of its first instance.
- size_t Add(const string &s) {
+ size_t Add(const string& s) {
map<string, size_t>::iterator it = added_.find(s);
if (it != added_.end())
return it->second;
@@ -127,7 +127,7 @@ class StringAssembler: public Section {
class StabsAssembler: public Section {
public:
// Create a StabsAssembler that uses StringAssembler for its strings.
- StabsAssembler(StringAssembler *string_assembler)
+ StabsAssembler(StringAssembler* string_assembler)
: Section(string_assembler->endianness()),
string_assembler_(string_assembler),
value_size_(0),
@@ -137,7 +137,7 @@ class StabsAssembler: public Section {
// Accessor and setter for value_size_.
size_t value_size() const { return value_size_; }
- StabsAssembler &set_value_size(size_t value_size) {
+ StabsAssembler& set_value_size(size_t value_size) {
value_size_ = value_size;
return *this;
}
@@ -147,7 +147,7 @@ class StabsAssembler: public Section {
// its compilation unit's portion of the .stabstr section; this can be a
// value generated by a StringAssembler. Return a reference to this
// StabsAssembler.
- StabsAssembler &Stab(uint8_t type, uint8_t other, Label descriptor,
+ StabsAssembler& Stab(uint8_t type, uint8_t other, Label descriptor,
Label value, Label name) {
D32(name);
D8(type);
@@ -159,15 +159,15 @@ class StabsAssembler: public Section {
}
// As above, but automatically add NAME to our StringAssembler.
- StabsAssembler &Stab(uint8_t type, uint8_t other, Label descriptor,
- Label value, const string &name) {
+ StabsAssembler& Stab(uint8_t type, uint8_t other, Label descriptor,
+ Label value, const string& name) {
return Stab(type, other, descriptor, value, string_assembler_->Add(name));
}
// Start a compilation unit named NAME, with an N_UNDF symbol to start
// it, and its own portion of the string section. Return a reference to
// this StabsAssembler.
- StabsAssembler &StartCU(const string &name) {
+ StabsAssembler& StartCU(const string& name) {
assert(!cu_header_);
cu_header_ = new CUHeader;
string_assembler_->StartCU();
@@ -180,7 +180,7 @@ class StabsAssembler: public Section {
// Close off the current compilation unit. Return a reference to this
// StabsAssembler.
- StabsAssembler &EndCU() {
+ StabsAssembler& EndCU() {
assert(cu_header_);
cu_header_->final_entry_count = entry_count_;
cu_header_->final_string_size = string_assembler_->EndCU();
@@ -201,7 +201,7 @@ class StabsAssembler: public Section {
};
// The strings for our STABS entries.
- StringAssembler *string_assembler_;
+ StringAssembler* string_assembler_;
// The size of the 'value' field of stabs entries in this section.
size_t value_size_;
@@ -211,20 +211,20 @@ class StabsAssembler: public Section {
// Header labels for this compilation unit, if we've started one but not
// finished it.
- CUHeader *cu_header_;
+ CUHeader* cu_header_;
};
class MockStabsReaderHandler: public StabsHandler {
public:
MOCK_METHOD3(StartCompilationUnit,
- bool(const char *, uint64_t, const char *));
+ bool(const char*, uint64_t, const char*));
MOCK_METHOD1(EndCompilationUnit, bool(uint64_t));
- MOCK_METHOD2(StartFunction, bool(const string &, uint64_t));
+ MOCK_METHOD2(StartFunction, bool(const string&, uint64_t));
MOCK_METHOD1(EndFunction, bool(uint64_t));
- MOCK_METHOD3(Line, bool(uint64_t, const char *, int));
- MOCK_METHOD2(Extern, bool(const string &, uint64_t));
- void Warning(const char *format, ...) { MockWarning(format); }
- MOCK_METHOD1(MockWarning, void(const char *));
+ MOCK_METHOD3(Line, bool(uint64_t, const char*, int));
+ MOCK_METHOD2(Extern, bool(const string&, uint64_t));
+ void Warning(const char* format, ...) { MockWarning(format); }
+ MOCK_METHOD1(MockWarning, void(const char*));
};
struct StabsFixture {
@@ -243,9 +243,9 @@ struct StabsFixture {
// Run the parser on the test input, passing whatever we find to HANDLER.
StabsReader reader(
- reinterpret_cast<const uint8_t *>(stabs_contents.data()),
+ reinterpret_cast<const uint8_t*>(stabs_contents.data()),
stabs_contents.size(),
- reinterpret_cast<const uint8_t *>(stabstr_contents.data()),
+ reinterpret_cast<const uint8_t*>(stabstr_contents.data()),
stabstr_contents.size(),
stabs.endianness() == kBigEndian, stabs.value_size(), unitized,
&mock_handler);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.cc b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.cc
index 049a6cc63e0..05b25a74e04 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.cc
@@ -45,7 +45,7 @@ namespace google_breakpad {
// Demangle using abi call.
// Older GCC may not support it.
-static string Demangle(const string &mangled) {
+static string Demangle(const string& mangled) {
int status = 0;
char *demangled = abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status);
if (status == 0 && demangled != NULL) {
@@ -58,7 +58,7 @@ static string Demangle(const string &mangled) {
StabsToModule::~StabsToModule() {
// Free any functions we've accumulated but not added to the module.
- for (vector<Module::Function *>::const_iterator func_it = functions_.begin();
+ for (vector<Module::Function*>::const_iterator func_it = functions_.begin();
func_it != functions_.end(); func_it++)
delete *func_it;
// Free any function that we're currently within.
@@ -87,7 +87,7 @@ bool StabsToModule::EndCompilationUnit(uint64_t address) {
return true;
}
-bool StabsToModule::StartFunction(const string &name,
+bool StabsToModule::StartFunction(const string& name,
uint64_t address) {
assert(!current_function_);
Module::Function *f = new Module::Function(Demangle(name), address);
@@ -131,7 +131,7 @@ bool StabsToModule::Line(uint64_t address, const char *name, int number) {
return true;
}
-bool StabsToModule::Extern(const string &name, uint64_t address) {
+bool StabsToModule::Extern(const string& name, uint64_t address) {
Module::Extern *ext = new Module::Extern(address);
// Older libstdc++ demangle implementations can crash on unexpected
// input, so be careful about what gets passed in.
@@ -160,7 +160,7 @@ void StabsToModule::Finalize() {
sort(functions_.begin(), functions_.end(),
Module::Function::CompareByAddress);
- for (vector<Module::Function *>::const_iterator func_it = functions_.begin();
+ for (vector<Module::Function*>::const_iterator func_it = functions_.begin();
func_it != functions_.end();
func_it++) {
Module::Function *f = *func_it;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.h b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.h
index 5e04fa79279..6f6e0ed7faf 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module.h
@@ -76,10 +76,10 @@ class StabsToModule: public google_breakpad::StabsHandler {
bool StartCompilationUnit(const char *name, uint64_t address,
const char *build_directory);
bool EndCompilationUnit(uint64_t address);
- bool StartFunction(const string &name, uint64_t address);
+ bool StartFunction(const string& name, uint64_t address);
bool EndFunction(uint64_t address);
bool Line(uint64_t address, const char *name, int number);
- bool Extern(const string &name, uint64_t address);
+ bool Extern(const string& name, uint64_t address);
void Warning(const char *format, ...);
// Do any final processing necessary to make module_ contain all the
@@ -107,7 +107,7 @@ class StabsToModule: public google_breakpad::StabsHandler {
// We could just stick them in module_ from the outset, but if
// module_ already contains data gathered from other debugging
// formats, that would complicate the size computation.
- vector<Module::Function *> functions_;
+ vector<Module::Function*> functions_;
// Boundary addresses. STABS doesn't necessarily supply sizes for
// functions and lines, so we need to compute them ourselves by
diff --git a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module_unittest.cc
index aae0047667c..9c134e733e2 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/stabs_to_module_unittest.cc
@@ -58,7 +58,7 @@ TEST(StabsToModule, SimpleCU) {
Module::File *file = m.FindExistingFile("source-file-name");
ASSERT_TRUE(file != NULL);
- vector<Module::Function *> functions;
+ vector<Module::Function*> functions;
m.GetFunctions(&functions, functions.end());
ASSERT_EQ((size_t) 1, functions.size());
Module::Function *function = functions[0];
@@ -88,7 +88,7 @@ TEST(StabsToModule, Externs) {
h.Finalize();
// Now check to see what has been added to the Module.
- vector<Module::Extern *> externs;
+ vector<Module::Extern*> externs;
m.GetExterns(&externs, externs.end());
ASSERT_EQ((size_t) 3, externs.size());
Module::Extern *extern1 = externs[0];
@@ -124,7 +124,7 @@ TEST(StabsToModule, DuplicateFunctionNames) {
Module::File *file = m.FindExistingFile("compilation-unit");
ASSERT_TRUE(file != NULL);
- vector<Module::Function *> functions;
+ vector<Module::Function*> functions;
m.GetFunctions(&functions, functions.end());
ASSERT_EQ(1U, functions.size());
@@ -159,7 +159,7 @@ TEST(InferSizes, LineSize) {
Module::File *file2 = m.FindExistingFile("source-file-name-2");
ASSERT_TRUE(file2 != NULL);
- vector<Module::Function *> functions;
+ vector<Module::Function*> functions;
m.GetFunctions(&functions, functions.end());
ASSERT_EQ((size_t) 1, functions.size());
@@ -204,7 +204,7 @@ TEST(FunctionNames, Mangled) {
Module::File *file = m.FindExistingFile("compilation-unit");
ASSERT_TRUE(file != NULL);
- vector<Module::Function *> functions;
+ vector<Module::Function*> functions;
m.GetFunctions(&functions, functions.end());
ASSERT_EQ(1U, functions.size());
diff --git a/chromium/third_party/breakpad/breakpad/src/common/string_conversion.cc b/chromium/third_party/breakpad/breakpad/src/common/string_conversion.cc
index 11d60a3664a..6a78ed7e47e 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/string_conversion.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/string_conversion.cc
@@ -38,15 +38,15 @@ namespace google_breakpad {
using std::vector;
-void UTF8ToUTF16(const char *in, vector<uint16_t> *out) {
+void UTF8ToUTF16(const char* in, vector<uint16_t>* out) {
size_t source_length = strlen(in);
- const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in);
- const UTF8 *source_end_ptr = source_ptr + source_length;
+ const UTF8* source_ptr = reinterpret_cast<const UTF8*>(in);
+ const UTF8* source_end_ptr = source_ptr + source_length;
// Erase the contents and zero fill to the expected size
out->clear();
out->insert(out->begin(), source_length, 0);
- uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity();
+ uint16_t* target_ptr = &(*out)[0];
+ uint16_t* target_end_ptr = target_ptr + out->capacity();
ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
strictConversion);
@@ -55,11 +55,11 @@ void UTF8ToUTF16(const char *in, vector<uint16_t> *out) {
out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0);
}
-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 + 1;
- uint16_t *target_ptr = out;
- uint16_t *target_end_ptr = target_ptr + 2;
+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 + 1;
+ uint16_t* target_ptr = out;
+ uint16_t* target_end_ptr = target_ptr + 2;
out[0] = out[1] = 0;
// Process one character at a time
@@ -69,28 +69,28 @@ int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) {
strictConversion);
if (result == conversionOK)
- return static_cast<int>(source_ptr - reinterpret_cast<const UTF8 *>(in));
+ return static_cast<int>(source_ptr - reinterpret_cast<const UTF8*>(in));
// Add another character to the input stream and try again
- source_ptr = reinterpret_cast<const UTF8 *>(in);
+ source_ptr = reinterpret_cast<const UTF8*>(in);
++source_end_ptr;
- if (source_end_ptr > reinterpret_cast<const UTF8 *>(in) + in_length)
+ if (source_end_ptr > reinterpret_cast<const UTF8*>(in) + in_length)
break;
}
return 0;
}
-void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out) {
+void UTF32ToUTF16(const wchar_t* in, vector<uint16_t>* out) {
size_t source_length = wcslen(in);
- const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(in);
- const UTF32 *source_end_ptr = source_ptr + source_length;
+ const UTF32* source_ptr = reinterpret_cast<const UTF32*>(in);
+ const UTF32* source_end_ptr = source_ptr + source_length;
// Erase the contents and zero fill to the expected size
out->clear();
out->insert(out->begin(), source_length, 0);
- uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity();
+ uint16_t* target_ptr = &(*out)[0];
+ uint16_t* target_end_ptr = target_ptr + out->capacity();
ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
strictConversion);
@@ -100,10 +100,10 @@ void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out) {
}
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;
+ 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;
out[0] = out[1] = 0;
ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
@@ -118,15 +118,15 @@ static inline uint16_t Swap(uint16_t value) {
return (value >> 8) | static_cast<uint16_t>(value << 8);
}
-string UTF16ToUTF8(const vector<uint16_t> &in, bool swap) {
- const UTF16 *source_ptr = &in[0];
+string UTF16ToUTF8(const vector<uint16_t>& in, bool swap) {
+ const UTF16* source_ptr = &in[0];
scoped_array<uint16_t> source_buffer;
// If we're to swap, we need to make a local copy and swap each byte pair
if (swap) {
int idx = 0;
source_buffer.reset(new uint16_t[in.size()]);
- UTF16 *source_buffer_ptr = source_buffer.get();
+ UTF16* source_buffer_ptr = source_buffer.get();
for (vector<uint16_t>::const_iterator it = in.begin();
it != in.end(); ++it, ++idx)
source_buffer_ptr[idx] = Swap(*it);
@@ -135,17 +135,17 @@ string UTF16ToUTF8(const vector<uint16_t> &in, bool swap) {
}
// The maximum expansion would be 4x the size of the input string.
- const UTF16 *source_end_ptr = source_ptr + in.size();
+ const UTF16* source_end_ptr = source_ptr + in.size();
size_t target_capacity = in.size() * 4;
scoped_array<UTF8> target_buffer(new UTF8[target_capacity]);
- UTF8 *target_ptr = target_buffer.get();
- UTF8 *target_end_ptr = target_ptr + target_capacity;
+ UTF8* target_ptr = target_buffer.get();
+ UTF8* target_end_ptr = target_ptr + target_capacity;
ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr,
&target_ptr, target_end_ptr,
strictConversion);
if (result == conversionOK) {
- const char *targetPtr = reinterpret_cast<const char *>(target_buffer.get());
+ const char* targetPtr = reinterpret_cast<const char*>(target_buffer.get());
return targetPtr;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/common/string_conversion.h b/chromium/third_party/breakpad/breakpad/src/common/string_conversion.h
index b9ba96a2e17..02d1486aaa6 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/string_conversion.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/string_conversion.h
@@ -44,24 +44,24 @@ using std::vector;
// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the
// conversion failed, |out| will be zero length.
-void UTF8ToUTF16(const char *in, vector<uint16_t> *out);
+void UTF8ToUTF16(const char* in, vector<uint16_t>* out);
// Convert at least one character (up to a maximum of |in_length|) from |in|
// to UTF-16 into |out|. Return the number of characters consumed from |in|.
// Any unused characters in |out| will be initialized to 0. No memory will
// be allocated by this routine.
-int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]);
+int UTF8ToUTF16Char(const char* in, int in_length, uint16_t out[2]);
// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the
// conversion failed, |out| will be zero length.
-void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out);
+void UTF32ToUTF16(const wchar_t* in, vector<uint16_t>* out);
// Convert |in| to UTF-16 into |out|. Any unused characters in |out| will be
// initialized to 0. No memory will be allocated by this routine.
void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]);
// Convert |in| to UTF-8. If |swap| is true, swap bytes before converting.
-string UTF16ToUTF8(const vector<uint16_t> &in, bool swap);
+string UTF16ToUTF8(const vector<uint16_t>& in, bool swap);
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/common/test_assembler.cc b/chromium/third_party/breakpad/breakpad/src/common/test_assembler.cc
index 1e783b45c5e..8a48bfb0be5 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/test_assembler.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/test_assembler.cc
@@ -46,7 +46,7 @@ using std::back_insert_iterator;
Label::Label() : value_(new Binding()) { }
Label::Label(uint64_t value) : value_(new Binding(value)) { }
-Label::Label(const Label &label) {
+Label::Label(const Label& label) {
value_ = label.value_;
value_->Acquire();
}
@@ -54,12 +54,12 @@ Label::~Label() {
if (value_->Release()) delete value_;
}
-Label &Label::operator=(uint64_t value) {
+Label& Label::operator=(uint64_t value) {
value_->Set(NULL, value);
return *this;
}
-Label &Label::operator=(const Label &label) {
+Label& Label::operator=(const Label& label) {
value_->Set(label.value_, 0);
return *this;
}
@@ -89,7 +89,7 @@ Label Label::operator-(uint64_t subtrahend) const {
#define ALWAYS_EVALUATE_AND_ASSERT(x) assert(x)
#endif
-uint64_t Label::operator-(const Label &label) const {
+uint64_t Label::operator-(const Label& label) const {
uint64_t offset;
ALWAYS_EVALUATE_AND_ASSERT(IsKnownOffsetFrom(label, &offset));
return offset;
@@ -101,8 +101,8 @@ uint64_t Label::Value() const {
return v;
};
-bool Label::IsKnownConstant(uint64_t *value_p) const {
- Binding *base;
+bool Label::IsKnownConstant(uint64_t* value_p) const {
+ Binding* base;
uint64_t addend;
value_->Get(&base, &addend);
if (base != NULL) return false;
@@ -110,9 +110,9 @@ bool Label::IsKnownConstant(uint64_t *value_p) const {
return true;
}
-bool Label::IsKnownOffsetFrom(const Label &label, uint64_t *offset_p) const
+bool Label::IsKnownOffsetFrom(const Label& label, uint64_t* offset_p) const
{
- Binding *label_base, *this_base;
+ Binding* label_base, *this_base;
uint64_t label_addend, this_addend;
label.value_->Get(&label_base, &label_addend);
value_->Get(&this_base, &this_addend);
@@ -135,7 +135,7 @@ Label::Binding::~Binding() {
delete base_;
}
-void Label::Binding::Set(Binding *binding, uint64_t addend) {
+void Label::Binding::Set(Binding* binding, uint64_t addend) {
if (!base_ && !binding) {
// We're equating two constants. This could be okay.
assert(addend_ == addend);
@@ -183,13 +183,13 @@ void Label::Binding::Set(Binding *binding, uint64_t addend) {
}
}
-void Label::Binding::Get(Binding **base, uint64_t *addend) {
+void Label::Binding::Get(Binding** base, uint64_t* addend) {
if (base_ && base_ != this) {
// Recurse to find the end of our reference chain (the root of our
// tree), and then rewrite every binding along the chain to refer
// to it directly, adjusting addends appropriately. (This is why
// this member function isn't this-const.)
- Binding *final_base;
+ Binding* final_base;
uint64_t final_addend;
base_->Get(&final_base, &final_addend);
if (final_base) final_base->Acquire();
@@ -218,14 +218,14 @@ static inline void InsertEndian(test_assembler::Endianness endianness,
}
}
-Section &Section::Append(Endianness endianness, size_t size, uint64_t number) {
+Section& Section::Append(Endianness endianness, size_t size, uint64_t number) {
InsertEndian(endianness, size, number,
back_insert_iterator<string>(contents_));
return *this;
}
-Section &Section::Append(Endianness endianness, size_t size,
- const Label &label) {
+Section& Section::Append(Endianness endianness, size_t size,
+ const Label& label) {
// If this label's value is known, there's no reason to waste an
// entry in references_ on it.
uint64_t value;
@@ -246,14 +246,14 @@ Section &Section::Append(Endianness endianness, size_t size,
#define ENDIANNESS(e) ENDIANNESS_ ## e
#define DEFINE_SHORT_APPEND_NUMBER_ENDIAN(e, bits) \
- Section &Section::e ## bits(uint ## bits ## _t v) { \
+ Section& Section::e ## bits(uint ## bits ## _t v) { \
InsertEndian(ENDIANNESS(e), bits / 8, v, \
back_insert_iterator<string>(contents_)); \
return *this; \
}
#define DEFINE_SHORT_APPEND_LABEL_ENDIAN(e, bits) \
- Section &Section::e ## bits(const Label &v) { \
+ Section& Section::e ## bits(const Label& v) { \
return Append(ENDIANNESS(e), bits / 8, v); \
}
@@ -272,13 +272,13 @@ DEFINE_SHORT_APPEND_ENDIAN(B, 32);
DEFINE_SHORT_APPEND_ENDIAN(B, 64);
#define DEFINE_SHORT_APPEND_NUMBER_DEFAULT(bits) \
- Section &Section::D ## bits(uint ## bits ## _t v) { \
+ Section& Section::D ## bits(uint ## bits ## _t v) { \
InsertEndian(endianness_, bits / 8, v, \
back_insert_iterator<string>(contents_)); \
return *this; \
}
#define DEFINE_SHORT_APPEND_LABEL_DEFAULT(bits) \
- Section &Section::D ## bits(const Label &v) { \
+ Section& Section::D ## bits(const Label& v) { \
return Append(endianness_, bits / 8, v); \
}
#define DEFINE_SHORT_APPEND_DEFAULT(bits) \
@@ -290,7 +290,7 @@ DEFINE_SHORT_APPEND_DEFAULT(16);
DEFINE_SHORT_APPEND_DEFAULT(32);
DEFINE_SHORT_APPEND_DEFAULT(64);
-Section &Section::Append(const Section &section) {
+Section& Section::Append(const Section& section) {
size_t base = contents_.size();
contents_.append(section.contents_);
for (vector<Reference>::const_iterator it = section.references_.begin();
@@ -300,7 +300,7 @@ Section &Section::Append(const Section &section) {
return *this;
}
-Section &Section::LEB128(long long value) {
+Section& Section::LEB128(long long value) {
while (value < -0x40 || 0x3f < value) {
contents_ += (value & 0x7f) | 0x80;
if (value < 0)
@@ -312,7 +312,7 @@ Section &Section::LEB128(long long value) {
return *this;
}
-Section &Section::ULEB128(uint64_t value) {
+Section& Section::ULEB128(uint64_t value) {
while (value > 0x7f) {
contents_ += (value & 0x7f) | 0x80;
value = (value >> 7);
@@ -321,7 +321,7 @@ Section &Section::ULEB128(uint64_t value) {
return *this;
}
-Section &Section::Align(size_t alignment, uint8_t pad_byte) {
+Section& Section::Align(size_t alignment, uint8_t pad_byte) {
// ALIGNMENT must be a power of two.
assert(((alignment - 1) & alignment) == 0);
size_t new_size = (contents_.size() + alignment - 1) & ~(alignment - 1);
@@ -335,11 +335,11 @@ void Section::Clear() {
references_.clear();
}
-bool Section::GetContents(string *contents) {
+bool Section::GetContents(string* contents) {
// For each label reference, find the label's value, and patch it into
// the section's contents.
for (size_t i = 0; i < references_.size(); i++) {
- Reference &r = references_[i];
+ Reference& r = references_[i];
uint64_t value;
if (!r.label.IsKnownConstant(&value)) {
fprintf(stderr, "Undefined label #%zu at offset 0x%zx\n", i, r.offset);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/test_assembler.h b/chromium/third_party/breakpad/breakpad/src/common/test_assembler.h
index 373dbebacd0..125ef4503e0 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/test_assembler.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/test_assembler.h
@@ -111,7 +111,7 @@ class Label {
public:
Label(); // An undefined label.
Label(uint64_t value); // A label with a fixed value
- Label(const Label &value); // A label equal to another.
+ Label(const Label& value); // A label equal to another.
~Label();
// Return this label's value; it must be known.
@@ -124,18 +124,18 @@ class Label {
// former could fail if the label is not yet defined and the latter won't.
uint64_t Value() const;
- Label &operator=(uint64_t value);
- Label &operator=(const Label &value);
+ Label& operator=(uint64_t value);
+ Label& operator=(const Label& value);
Label operator+(uint64_t addend) const;
Label operator-(uint64_t subtrahend) const;
- uint64_t operator-(const Label &subtrahend) const;
+ uint64_t operator-(const Label& subtrahend) const;
// We could also provide == and != that work on undefined, but
// related, labels.
// Return true if this label's value is known. If VALUE_P is given,
// set *VALUE_P to the known value if returning true.
- bool IsKnownConstant(uint64_t *value_p = NULL) const;
+ bool IsKnownConstant(uint64_t* value_p = NULL) const;
// Return true if the offset from LABEL to this label is known. If
// OFFSET_P is given, set *OFFSET_P to the offset when returning true.
@@ -155,7 +155,7 @@ class Label {
// l-m // -10
// m-l // 10
// m.Value() // error: m's value is not known
- bool IsKnownOffsetFrom(const Label &label, uint64_t *offset_p = NULL) const;
+ bool IsKnownOffsetFrom(const Label& label, uint64_t* offset_p = NULL) const;
private:
// A label's value, or if that is not yet known, how the value is
@@ -186,7 +186,7 @@ class Label {
// Update every binding on this binding's chain to point directly
// to BINDING, or to be a constant, with addends adjusted
// appropriately.
- void Set(Binding *binding, uint64_t value);
+ void Set(Binding* binding, uint64_t value);
// Return what we know about the value of this binding.
// - If this binding's value is a known constant, set BASE to
@@ -198,7 +198,7 @@ class Label {
// value.
// - If this binding is unconstrained, set BASE to this, and leave
// ADDEND unchanged.
- void Get(Binding **base, uint64_t *addend);
+ void Get(Binding** base, uint64_t* addend);
private:
// There are three cases:
@@ -220,7 +220,7 @@ class Label {
// operations on bindings do path compression: they change every
// binding on the chain to point directly to the final value,
// adjusting addends as appropriate.
- Binding *base_;
+ Binding* base_;
uint64_t addend_;
// The number of Labels and Bindings pointing to this binding.
@@ -230,10 +230,10 @@ class Label {
};
// This label's value.
- Binding *value_;
+ Binding* value_;
};
-inline Label operator+(uint64_t a, const Label &l) { return l + a; }
+inline Label operator+(uint64_t a, const Label& l) { return l + a; }
// Note that int-Label isn't defined, as negating a Label is not an
// operation we support.
@@ -288,18 +288,18 @@ class Section {
// Append the SIZE bytes at DATA or the contents of STRING to the
// end of this section. Return a reference to this section.
- Section &Append(const uint8_t *data, size_t size) {
- contents_.append(reinterpret_cast<const char *>(data), size);
+ Section& Append(const uint8_t* data, size_t size) {
+ contents_.append(reinterpret_cast<const char*>(data), size);
return *this;
};
- Section &Append(const string &data) {
+ Section& Append(const string& data) {
contents_.append(data);
return *this;
};
// Append SIZE copies of BYTE to the end of this section. Return a
// reference to this section.
- Section &Append(size_t size, uint8_t byte) {
+ Section& Append(size_t size, uint8_t byte) {
contents_.append(size, (char) byte);
return *this;
}
@@ -307,8 +307,8 @@ class Section {
// Append NUMBER to this section. ENDIANNESS is the endianness to
// use to write the number. SIZE is the length of the number in
// bytes. Return a reference to this section.
- Section &Append(Endianness endianness, size_t size, uint64_t number);
- Section &Append(Endianness endianness, size_t size, const Label &label);
+ Section& Append(Endianness endianness, size_t size, uint64_t number);
+ Section& Append(Endianness endianness, size_t size, const Label& label);
// Append SECTION to the end of this section. The labels SECTION
// refers to need not be defined yet.
@@ -317,11 +317,11 @@ class Section {
// SECTION. If placing SECTION within 'this' provides new
// constraints on existing labels' values, then it's up to the
// caller to fiddle with those labels as needed.
- Section &Append(const Section &section);
+ Section& Append(const Section& section);
// Append the contents of DATA as a series of bytes terminated by
// a NULL character.
- Section &AppendCString(const string &data) {
+ Section& AppendCString(const string& data) {
Append(data);
contents_ += '\0';
return *this;
@@ -329,7 +329,7 @@ class Section {
// Append at most SIZE bytes from DATA; if DATA is less than SIZE bytes
// long, pad with '\0' characters.
- Section &AppendCString(const string &data, size_t size) {
+ Section& AppendCString(const string& data, size_t size) {
contents_.append(data, 0, size);
if (data.size() < size)
Append(size - data.size(), 0);
@@ -352,18 +352,18 @@ class Section {
// the compiler will properly sign-extend a signed value before
// passing it to the function, at which point the function's
// behavior is the same either way.
- Section &L8(uint8_t value) { contents_ += value; return *this; }
- Section &B8(uint8_t value) { contents_ += value; return *this; }
- Section &D8(uint8_t value) { contents_ += value; return *this; }
+ Section& L8(uint8_t value) { contents_ += value; return *this; }
+ Section& B8(uint8_t value) { contents_ += value; return *this; }
+ Section& D8(uint8_t value) { contents_ += value; return *this; }
Section &L16(uint16_t), &L32(uint32_t), &L64(uint64_t),
&B16(uint16_t), &B32(uint32_t), &B64(uint64_t),
&D16(uint16_t), &D32(uint32_t), &D64(uint64_t);
- Section &L8(const Label &label), &L16(const Label &label),
- &L32(const Label &label), &L64(const Label &label),
- &B8(const Label &label), &B16(const Label &label),
- &B32(const Label &label), &B64(const Label &label),
- &D8(const Label &label), &D16(const Label &label),
- &D32(const Label &label), &D64(const Label &label);
+ Section &L8(const Label& label), &L16(const Label& label),
+ &L32(const Label& label), &L64(const Label& label),
+ &B8(const Label& label), &B16(const Label& label),
+ &B32(const Label& label), &B64(const Label& label),
+ &D8(const Label& label), &D16(const Label& label),
+ &D32(const Label& label), &D64(const Label& label);
// Append VALUE in a signed LEB128 (Little-Endian Base 128) form.
//
@@ -383,7 +383,7 @@ class Section {
//
// Note that VALUE cannot be a Label (we would have to implement
// relaxation).
- Section &LEB128(long long value);
+ Section& LEB128(long long value);
// Append VALUE in unsigned LEB128 (Little-Endian Base 128) form.
//
@@ -399,13 +399,13 @@ class Section {
//
// Note that VALUE cannot be a Label (we would have to implement
// relaxation).
- Section &ULEB128(uint64_t value);
+ Section& ULEB128(uint64_t value);
// Jump to the next location aligned on an ALIGNMENT-byte boundary,
// relative to the start of the section. Fill the gap with PAD_BYTE.
// ALIGNMENT must be a power of two. Return a reference to this
// section.
- Section &Align(size_t alignment, uint8_t pad_byte = 0);
+ Section& Align(size_t alignment, uint8_t pad_byte = 0);
// Clear the contents of this section.
void Clear();
@@ -436,19 +436,19 @@ class Section {
Label Here() const { return start_ + Size(); }
// Set *LABEL to Here, and return a reference to this section.
- Section &Mark(Label *label) { *label = Here(); return *this; }
+ Section& Mark(Label* label) { *label = Here(); return *this; }
// If there are no undefined label references left in this
// section, set CONTENTS to the contents of this section, as a
// string, and clear this section. Return true on success, or false
// if there were still undefined labels.
- bool GetContents(string *contents);
+ bool GetContents(string* contents);
private:
// Used internally. A reference to a label's value.
struct Reference {
Reference(size_t set_offset, Endianness set_endianness, size_t set_size,
- const Label &set_label)
+ const Label& set_label)
: offset(set_offset), endianness(set_endianness), size(set_size),
label(set_label) { }
diff --git a/chromium/third_party/breakpad/breakpad/src/common/test_assembler_unittest.cc b/chromium/third_party/breakpad/breakpad/src/common/test_assembler_unittest.cc
index 94b5a5ce5fb..bda25ebfc77 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/test_assembler_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/test_assembler_unittest.cc
@@ -755,7 +755,7 @@ const uint8_t SectionFixture::data[] = {
{ \
static const uint8_t expected_bytes[] = b; \
ASSERT_EQ(sizeof(expected_bytes), s.size()); \
- ASSERT_TRUE(memcmp(s.data(), (const char *) expected_bytes, \
+ ASSERT_TRUE(memcmp(s.data(), (const char*) expected_bytes, \
sizeof(expected_bytes)) == 0); \
} \
while(0)
@@ -766,7 +766,7 @@ TEST_F(Append, Bytes) {
section.Append(data, sizeof(data));
ASSERT_TRUE(section.GetContents(&contents));
ASSERT_EQ(sizeof(data), contents.size());
- EXPECT_TRUE(0 == memcmp(contents.data(), (const char *) data, sizeof(data)));
+ EXPECT_TRUE(0 == memcmp(contents.data(), (const char*) data, sizeof(data)));
}
TEST_F(Append, BytesTwice) {
@@ -774,9 +774,9 @@ TEST_F(Append, BytesTwice) {
section.Append(data, sizeof(data));
ASSERT_TRUE(section.GetContents(&contents));
ASSERT_EQ(2 * sizeof(data), contents.size());
- ASSERT_TRUE(0 == memcmp(contents.data(), (const char *) data, sizeof(data)));
+ ASSERT_TRUE(0 == memcmp(contents.data(), (const char*) data, sizeof(data)));
ASSERT_TRUE(0 == memcmp(contents.data() + sizeof(data),
- (const char *) data, sizeof(data)));
+ (const char*) data, sizeof(data)));
}
TEST_F(Append, String) {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.cc b/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.cc
index b0cc907821e..efee0d58b91 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.cc
@@ -65,7 +65,7 @@ namespace {
HINTERNET handle_;
};
- wstring UTF8ToWide(const string &utf8) {
+ wstring UTF8ToWide(const string& utf8) {
if (utf8.length() == 0) {
return wstring();
}
@@ -85,7 +85,7 @@ namespace {
return result;
}
- string WideToMBCP(const wstring &wide, unsigned int cp) {
+ string WideToMBCP(const wstring& wide, unsigned int cp) {
if (wide.length() == 0) {
return string();
}
@@ -107,7 +107,7 @@ namespace {
return result;
}
- bool GetFileContents(const wstring &filename, vector<char> *contents) {
+ 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
@@ -141,10 +141,10 @@ namespace {
return rv;
}
- bool CheckParameters(const map<wstring, wstring> &parameters) {
+ 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;
+ const wstring& str = pos->first;
if (str.size() == 0) {
return false; // disallow empty parameter names
}
@@ -159,7 +159,7 @@ namespace {
}
// Converts a UTF16 string to UTF8.
- string WideToUTF8(const wstring &wide) {
+ string WideToUTF8(const wstring& wide) {
return WideToMBCP(wide, CP_UTF8);
}
@@ -305,7 +305,7 @@ namespace {
}
if (!HttpSendRequest(request.get(), NULL, 0,
- const_cast<char *>(request_body.data()),
+ const_cast<char*>(request_body.data()),
static_cast<DWORD>(request_body.size()))) {
return false;
}
@@ -351,7 +351,7 @@ namespace {
return wstring(temp);
}
- wstring GenerateMultipartPostRequestHeader(const wstring &boundary) {
+ wstring GenerateMultipartPostRequestHeader(const wstring& boundary) {
wstring header = L"Content-Type: multipart/form-data; boundary=";
header += boundary;
return header;
@@ -390,9 +390,9 @@ namespace {
return true;
}
- bool GenerateRequestBody(const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- const wstring &boundary,
+ 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()) {
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.h b/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.h
index 57e526e3f21..c7d8c6fec42 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/http_upload.h
@@ -114,8 +114,8 @@ class HTTPUpload {
// No instances of this class should be created.
// Disallow all constructors, destructors, and operator=.
HTTPUpload();
- explicit HTTPUpload(const HTTPUpload &);
- void operator=(const HTTPUpload &);
+ explicit HTTPUpload(const HTTPUpload&);
+ void operator=(const HTTPUpload&);
~HTTPUpload();
};
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/omap.cc b/chromium/third_party/breakpad/breakpad/src/common/windows/omap.cc
index ba3ce86b8b7..5a821b64f45 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/omap.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/omap.cc
@@ -449,11 +449,11 @@ void BuildEndpointIndexMap(ImageMap* image_map) {
}
}
-void BuildSubsequentRVAMap(const OmapData &omap_data,
- std::map<DWORD, DWORD> *subsequent) {
+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);
+ const OmapFromTable& orig2tran =
+ reinterpret_cast<const OmapFromTable&>(omap_data.omap_from);
if (orig2tran.empty())
return;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.cc b/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.cc
index 4030a2e9535..0eeb30ccab3 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.cc
@@ -120,7 +120,7 @@ bool SymbolsMatch(IDiaSymbol* a, IDiaSymbol* b) {
return a_section == b_section && a_offset == b_offset;
}
-bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
+bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource>& data_source) {
if (SUCCEEDED(data_source.CoCreateInstance(CLSID_DiaSource))) {
return true;
}
@@ -134,7 +134,7 @@ bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
// 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;
+ const wchar_t* msdia_dll = nullptr;
if (CLSID_DiaSource == _uuidof(DiaSource100)) {
msdia_dll = L"msdia100.dll";
} else if (CLSID_DiaSource == _uuidof(DiaSource110)) {
@@ -147,7 +147,7 @@ bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
if (msdia_dll &&
SUCCEEDED(NoRegCoCreate(msdia_dll, CLSID_DiaSource, IID_IDiaDataSource,
- reinterpret_cast<void **>(&data_source)))) {
+ reinterpret_cast<void**>(&data_source)))) {
return true;
}
@@ -163,7 +163,7 @@ PDBSourceLineWriter::~PDBSourceLineWriter() {
Close();
}
-bool PDBSourceLineWriter::SetCodeFile(const wstring &exe_file) {
+bool PDBSourceLineWriter::SetCodeFile(const wstring& exe_file) {
if (code_file_.empty()) {
code_file_ = exe_file;
return true;
@@ -173,7 +173,7 @@ bool PDBSourceLineWriter::SetCodeFile(const wstring &exe_file) {
return exe_file == code_file_;
}
-bool PDBSourceLineWriter::Open(const wstring &file, FileFormat format) {
+bool PDBSourceLineWriter::Open(const wstring& file, FileFormat format) {
Close();
code_file_.clear();
@@ -228,7 +228,7 @@ bool PDBSourceLineWriter::Open(const wstring &file, FileFormat format) {
return true;
}
-bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) {
+bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers* lines) {
// The line number format is:
// <rva> <line number> <source file id>
CComPtr<IDiaLineNumber> line;
@@ -272,8 +272,8 @@ bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) {
return true;
}
-bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
- IDiaSymbol *block,
+bool PDBSourceLineWriter::PrintFunction(IDiaSymbol* function,
+ IDiaSymbol* block,
bool has_multiple_symbols) {
// The function format is:
// FUNC <address> <length> <param_stack_size> <function>
@@ -679,7 +679,7 @@ 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))) {
@@ -781,9 +781,9 @@ bool PDBSourceLineWriter::PrintPEInfo() {
// and scanf families, which are not as strict about input and in some cases
// don't provide a good way for the caller to determine if a conversion was
// successful.
-static bool wcstol_positive_strict(wchar_t *string, int *result) {
+static bool wcstol_positive_strict(wchar_t* string, int* result) {
int value = 0;
- for (wchar_t *c = string; *c != '\0'; ++c) {
+ for (wchar_t* c = string; *c != '\0'; ++c) {
int last_value = value;
value *= 10;
// Detect overflow.
@@ -821,7 +821,7 @@ bool PDBSourceLineWriter::FindPEFile() {
wstring file(symbols_file);
// Look for an EXE or DLL file.
- const wchar_t *extensions[] = { L"exe", L"dll" };
+ const wchar_t* extensions[] = { L"exe", L"dll" };
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) {
@@ -839,9 +839,9 @@ bool PDBSourceLineWriter::FindPEFile() {
}
// static
-bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
- BSTR *name,
- int *stack_param_size) {
+bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol* function,
+ BSTR* name,
+ int* stack_param_size) {
*stack_param_size = -1;
const DWORD undecorate_options = UNDNAME_NO_MS_KEYWORDS |
UNDNAME_NO_FUNCTION_RETURNS |
@@ -882,12 +882,12 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
// C++ uses a bogus "void" argument for functions and methods that don't
// take any parameters. Take it out of the undecorated name because it's
// ugly and unnecessary.
- const wchar_t *replace_string = L"(void)";
+ const wchar_t* replace_string = L"(void)";
const size_t replace_length = wcslen(replace_string);
- const wchar_t *replacement_string = L"()";
+ const wchar_t* replacement_string = L"()";
size_t length = wcslen(*name);
if (length >= replace_length) {
- wchar_t *name_end = *name + length - replace_length;
+ wchar_t* name_end = *name + length - replace_length;
if (wcscmp(name_end, replace_string) == 0) {
WindowsStringUtils::safe_wcscpy(name_end, replace_length,
replacement_string);
@@ -903,7 +903,7 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
// whether the undecorated name contains any ':' or '(' characters.
if (!wcschr(*name, ':') && !wcschr(*name, '(') &&
(*name[0] == '_' || *name[0] == '@')) {
- wchar_t *last_at = wcsrchr(*name + 1, '@');
+ wchar_t* last_at = wcsrchr(*name + 1, '@');
if (last_at && wcstol_positive_strict(last_at + 1, stack_param_size)) {
// If this function adheres to the fastcall convention, it accepts up
// to the first 8 bytes of parameters in registers (%ecx and %edx).
@@ -935,7 +935,7 @@ bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
}
// static
-int PDBSourceLineWriter::GetFunctionStackParamSize(IDiaSymbol *function) {
+int PDBSourceLineWriter::GetFunctionStackParamSize(IDiaSymbol* function) {
// This implementation is highly x86-specific.
// Gather the symbols corresponding to data.
@@ -1050,7 +1050,7 @@ next_child:
return param_size;
}
-bool PDBSourceLineWriter::WriteSymbols(FILE *symbol_file) {
+bool PDBSourceLineWriter::WriteSymbols(FILE* symbol_file) {
output_ = symbol_file;
// Load the OMAP information, and disable auto-translation of addresses in
@@ -1078,7 +1078,7 @@ void PDBSourceLineWriter::Close() {
}
}
-bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
+bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo* info) {
if (!info) {
return false;
}
@@ -1143,7 +1143,7 @@ bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
return true;
}
-bool PDBSourceLineWriter::GetPEInfo(PEModuleInfo *info) {
+bool PDBSourceLineWriter::GetPEInfo(PEModuleInfo* info) {
if (!info) {
return false;
}
@@ -1156,7 +1156,7 @@ bool PDBSourceLineWriter::GetPEInfo(PEModuleInfo *info) {
return ReadPEInfo(code_file_, info);
}
-bool PDBSourceLineWriter::UsesGUID(bool *uses_guid) {
+bool PDBSourceLineWriter::UsesGUID(bool* uses_guid) {
if (!uses_guid)
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.h b/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.h
index c0adf29f24b..00f6e592944 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/pdb_source_line_writer.h
@@ -65,7 +65,7 @@ class PDBSourceLineWriter {
// file must be available; Open will be if it is not.
// If there is already a pdb file open, it is automatically closed.
// Returns true on success.
- bool Open(const wstring &file, FileFormat format);
+ bool Open(const wstring& file, FileFormat format);
// Closes the current pdb file and its associated resources.
void Close();
@@ -77,7 +77,7 @@ class PDBSourceLineWriter {
// file and it must be called after Open() and before WriteMap().
// If Open() was called for an executable file, then it is an error to call
// SetCodeFile() with a different file path and it will return false.
- bool SetCodeFile(const wstring &exe_file);
+ bool SetCodeFile(const wstring& exe_file);
// Writes a Breakpad symbol file from the current pdb file to |symbol_file|.
// Returns true on success.
@@ -150,17 +150,17 @@ class PDBSourceLineWriter {
// Returns true if this filename has already been seen,
// and an ID is stored for it, or false if it has not.
- bool FileIDIsCached(const wstring &file) {
+ bool FileIDIsCached(const wstring& file) {
return unique_files_.find(file) != unique_files_.end();
}
// Cache this filename and ID for later reuse.
- void CacheFileID(const wstring &file, DWORD id) {
+ void CacheFileID(const wstring& file, DWORD id) {
unique_files_[file] = id;
}
// Store this ID in the cache as a duplicate for this filename.
- void StoreDuplicateFileID(const wstring &file, DWORD id) {
+ void StoreDuplicateFileID(const wstring& file, DWORD id) {
unordered_map<wstring, DWORD>::iterator iter = unique_files_.find(file);
if (iter != unique_files_.end()) {
// map this id to the previously seen one
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/pe_util.cc b/chromium/third_party/breakpad/breakpad/src/common/windows/pe_util.cc
index 9f9e8fabdeb..7dcfa7c9cac 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/pe_util.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/pe_util.cc
@@ -285,7 +285,7 @@ bool PrintPEFrameData(const wstring & pe_file, FILE * out_file)
unwind_rva = chained_func->UnwindInfoAddress;
}
- UnwindInfo *unwind_info = static_cast<UnwindInfo *>(
+ UnwindInfo *unwind_info = static_cast<UnwindInfo*>(
ImageRvaToVa(img->FileHeader,
img->MappedAddress,
unwind_rva,
@@ -351,7 +351,7 @@ bool PrintPEFrameData(const wstring & pe_file, FILE * out_file)
(unwind_info->unwind_code +
((unwind_info->count_of_codes + 1) & ~1)));
- unwind_info = static_cast<UnwindInfo *>(
+ unwind_info = static_cast<UnwindInfo*>(
ImageRvaToVa(img->FileHeader,
img->MappedAddress,
chained_func->UnwindInfoAddress,
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils-inl.h b/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils-inl.h
index 9b636072681..935e19f5274 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils-inl.h
@@ -72,26 +72,26 @@ class WindowsStringUtils {
// Roughly equivalent to MSVC8's wcscpy_s, except pre-MSVC8, this does
// not fail if source is longer than destination_size. The destination
// buffer is always 0-terminated.
- static void safe_wcscpy(wchar_t *destination, size_t destination_size,
- const wchar_t *source);
+ static void safe_wcscpy(wchar_t* destination, size_t destination_size,
+ const wchar_t* source);
// Roughly equivalent to MSVC8's wcsncpy_s, except that _TRUNCATE cannot
// be passed directly, and pre-MSVC8, this will not fail if source or count
// are longer than destination_size. The destination buffer is always
// 0-terminated.
- static void safe_wcsncpy(wchar_t *destination, size_t destination_size,
- const wchar_t *source, size_t count);
+ static void safe_wcsncpy(wchar_t* destination, size_t destination_size,
+ const wchar_t* source, size_t count);
// Performs multi-byte to wide character conversion on C++ strings, using
// mbstowcs_s (MSVC8) or mbstowcs (pre-MSVC8). Returns false on failure,
// without setting wcs.
- static bool safe_mbstowcs(const string &mbs, wstring *wcs);
+ static bool safe_mbstowcs(const string& mbs, wstring* wcs);
// The inverse of safe_mbstowcs.
- static bool safe_wcstombs(const wstring &wcs, string *mbs);
+ static bool safe_wcstombs(const wstring& wcs, string* mbs);
// Returns the base name of a file, e.g. strips off the path.
- static wstring GetBaseName(const wstring &filename);
+ static wstring GetBaseName(const wstring& filename);
private:
// Disallow instantiation and other object-based operations.
@@ -102,9 +102,9 @@ class WindowsStringUtils {
};
// static
-inline void WindowsStringUtils::safe_wcscpy(wchar_t *destination,
+inline void WindowsStringUtils::safe_wcscpy(wchar_t* destination,
size_t destination_size,
- const wchar_t *source) {
+ const wchar_t* source) {
#if _MSC_VER >= 1400 // MSVC 2005/8
wcscpy_s(destination, destination_size, source);
#else // _MSC_VER >= 1400
@@ -118,9 +118,9 @@ inline void WindowsStringUtils::safe_wcscpy(wchar_t *destination,
}
// static
-inline void WindowsStringUtils::safe_wcsncpy(wchar_t *destination,
+inline void WindowsStringUtils::safe_wcsncpy(wchar_t* destination,
size_t destination_size,
- const wchar_t *source,
+ const wchar_t* source,
size_t count) {
#if _MSC_VER >= 1400 // MSVC 2005/8
wcsncpy_s(destination, destination_size, source, count);
diff --git a/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils.cc b/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils.cc
index 272800035ca..90aab0386f6 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/windows/string_utils.cc
@@ -35,7 +35,7 @@
namespace google_breakpad {
// static
-wstring WindowsStringUtils::GetBaseName(const wstring &filename) {
+wstring WindowsStringUtils::GetBaseName(const wstring& filename) {
wstring base_name(filename);
size_t slash_pos = base_name.find_last_of(L"/\\");
if (slash_pos != wstring::npos) {
@@ -45,7 +45,7 @@ wstring WindowsStringUtils::GetBaseName(const wstring &filename) {
}
// static
-bool WindowsStringUtils::safe_mbstowcs(const string &mbs, wstring *wcs) {
+bool WindowsStringUtils::safe_mbstowcs(const string& mbs, wstring* wcs) {
assert(wcs);
// First, determine the length of the destination buffer.
@@ -88,7 +88,7 @@ bool WindowsStringUtils::safe_mbstowcs(const string &mbs, wstring *wcs) {
}
// static
-bool WindowsStringUtils::safe_wcstombs(const wstring &wcs, string *mbs) {
+bool WindowsStringUtils::safe_wcstombs(const wstring& wcs, string* mbs) {
assert(mbs);
// First, determine the length of the destination buffer.
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/basic_source_line_resolver.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/basic_source_line_resolver.h
index 91fb784173d..1c7bf465c7d 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/basic_source_line_resolver.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/basic_source_line_resolver.h
@@ -90,9 +90,9 @@ class SymbolParseHelper {
// can't be const. On success, <id>, and <filename> are stored in |*index|,
// and |*filename|. No allocation is done, |*filename| simply points inside
// |file_line|.
- static bool ParseFile(char *file_line, // in
- long *index, // out
- char **filename); // out
+ static bool ParseFile(char* file_line, // in
+ long* index, // out
+ char** filename); // out
// Parses a |function_line| declaration. Returns true on success.
// Format: FUNC [<multiple>] <address> <size> <stack_param_size> <name>.
@@ -101,12 +101,12 @@ class SymbolParseHelper {
// <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
- char **name); // out
+ static bool ParseFunction(char* function_line, // in
+ bool* is_multiple, // out
+ uint64_t* address, // out
+ uint64_t* size, // out
+ long* stack_param_size, // out
+ char** name); // out
// Parses a |line| declaration. Returns true on success.
// Format: <address> <size> <line number> <source file id>
@@ -114,11 +114,11 @@ class SymbolParseHelper {
// it can't be const. On success, <address>, <size>, <line number>, and
// <source file id> are stored in |*address|, |*size|, |*line_number|, and
// |*source_file|.
- static bool ParseLine(char *line_line, // in
- uint64_t *address, // out
- uint64_t *size, // out
- long *line_number, // out
- long *source_file); // out
+ static bool ParseLine(char* line_line, // in
+ uint64_t* address, // out
+ uint64_t* size, // out
+ long* line_number, // out
+ long* source_file); // out
// Parses a |public_line| declaration. Returns true on success.
// Format: PUBLIC [<multiple>] <address> <stack_param_size> <name>
@@ -127,15 +127,15 @@ class SymbolParseHelper {
// <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
+ static bool ParsePublicSymbol(char* public_line, // in
+ bool* is_multiple, // out
+ uint64_t* address, // out
+ long* stack_param_size, // out
+ char** name); // out
private:
// Used for success checks after strtoull and strtol.
- static bool IsValidAfterNumber(char *after_number);
+ static bool IsValidAfterNumber(char* after_number);
// Only allow static methods.
SymbolParseHelper();
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump.h
index d712cb6644e..1c40a821a92 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump.h
@@ -291,7 +291,7 @@ class MinidumpThread : public MinidumpObject {
// so a special getter is provided to retrieve this data from the
// MDRawThread structure. Returns false if the thread ID cannot be
// determined.
- virtual bool GetThreadID(uint32_t *thread_id) const;
+ virtual bool GetThreadID(uint32_t* thread_id) const;
// Print a human-readable representation of the object to stdout.
void Print();
@@ -549,9 +549,9 @@ class MinidumpModuleList : public MinidumpStream,
static uint32_t max_modules_;
// Access to modules using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int>* range_map_;
- MinidumpModules *modules_;
+ MinidumpModules* modules_;
uint32_t module_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList);
@@ -606,16 +606,16 @@ class MinidumpMemoryList : public MinidumpStream {
static uint32_t max_regions_;
// Access to memory regions using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int>* range_map_;
// The list of descriptors. This is maintained separately from the list
// of regions, because MemoryRegion doesn't own its MemoryDescriptor, it
// maintains a pointer to it. descriptors_ provides the storage for this
// purpose.
- MemoryDescriptors *descriptors_;
+ MemoryDescriptors* descriptors_;
// The list of regions.
- MemoryRegions *regions_;
+ MemoryRegions* regions_;
uint32_t region_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList);
@@ -640,7 +640,7 @@ class MinidumpException : public MinidumpStream {
// so a special getter is provided to retrieve this data from the
// MDRawExceptionStream structure. Returns false if the thread ID cannot
// be determined.
- bool GetThreadID(uint32_t *thread_id) const;
+ bool GetThreadID(uint32_t* thread_id) const;
MinidumpContext* GetContext();
@@ -862,9 +862,9 @@ class MinidumpUnloadedModuleList : public MinidumpStream,
static uint32_t max_modules_;
// Access to module indices using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int>* range_map_;
- MinidumpUnloadedModules *unloaded_modules_;
+ MinidumpUnloadedModules* unloaded_modules_;
uint32_t module_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleList);
@@ -919,8 +919,8 @@ class MinidumpBreakpadInfo : public MinidumpStream {
// treatment, so special getters are provided to retrieve this data from
// the MDRawBreakpadInfo structure. The getters return false if the thread
// IDs cannot be determined.
- bool GetDumpThreadID(uint32_t *thread_id) const;
- bool GetRequestingThreadID(uint32_t *thread_id) const;
+ bool GetDumpThreadID(uint32_t* thread_id) const;
+ bool GetRequestingThreadID(uint32_t* thread_id) const;
// Print a human-readable representation of the object to stdout.
void Print();
@@ -1003,7 +1003,7 @@ class MinidumpMemoryInfoList : public MinidumpStream {
bool Read(uint32_t expected_size) override;
// Access to memory info using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int>* range_map_;
MinidumpMemoryInfos* infos_;
uint32_t info_count_;
@@ -1056,7 +1056,7 @@ class MinidumpLinuxMaps : public MinidumpObject {
friend class MinidumpLinuxMapsList;
// This caller owns the pointer.
- explicit MinidumpLinuxMaps(Minidump *minidump);
+ explicit MinidumpLinuxMaps(Minidump* minidump);
// The memory region struct that this class wraps.
MappedMemoryRegion region_;
@@ -1075,9 +1075,9 @@ class MinidumpLinuxMapsList : public MinidumpStream {
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;
+ 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;
+ const MinidumpLinuxMaps* GetLinuxMapsAtIndex(unsigned int index) const;
// Print the contents of /proc/self/maps to stdout.
void Print() const;
@@ -1085,12 +1085,12 @@ class MinidumpLinuxMapsList : public MinidumpStream {
private:
friend class Minidump;
- typedef vector<MinidumpLinuxMaps *> MinidumpLinuxMappings;
+ typedef vector<MinidumpLinuxMaps*> MinidumpLinuxMappings;
static const uint32_t kStreamType = MD_LINUX_MAPS;
// The caller owns the pointer.
- explicit MinidumpLinuxMapsList(Minidump *minidump);
+ 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.
@@ -1098,7 +1098,7 @@ class MinidumpLinuxMapsList : public MinidumpStream {
bool Read(uint32_t expected_size) override;
// The list of individual mappings.
- MinidumpLinuxMappings *maps_;
+ MinidumpLinuxMappings* maps_;
// The number of mappings.
uint32_t maps_count_;
@@ -1200,7 +1200,7 @@ class Minidump {
MinidumpCrashpadInfo* GetCrashpadInfo();
// The next method also calls GetStream, but is exclusive for Linux dumps.
- virtual MinidumpLinuxMapsList *GetLinuxMapsList();
+ 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
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump_processor.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump_processor.h
index 387115ef71f..414050e9763 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump_processor.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/minidump_processor.h
@@ -70,7 +70,7 @@ class MinidumpProcessor {
~MinidumpProcessor();
// Processes the minidump file and fills process_state with the result.
- ProcessResult Process(const string &minidump_file,
+ ProcessResult Process(const string& minidump_file,
ProcessState* process_state);
// Processes the minidump structure and fills process_state with the
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_base.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_base.h
index c720b0c3254..fea1657c213 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_base.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_base.h
@@ -64,36 +64,36 @@ class SourceLineResolverBase : public SourceLineResolverInterface {
// LoadMap() method.
// Place dynamically allocated heap buffer in symbol_data. Caller has the
// ownership of the buffer, and should call delete [] to free the buffer.
- static bool ReadSymbolFile(const string &file_name,
- char **symbol_data,
- size_t *symbol_data_size);
+ static bool ReadSymbolFile(const string& file_name,
+ char** symbol_data,
+ size_t* symbol_data_size);
protected:
// Users are not allowed create SourceLineResolverBase instance directly.
- SourceLineResolverBase(ModuleFactory *module_factory);
+ SourceLineResolverBase(ModuleFactory* module_factory);
virtual ~SourceLineResolverBase();
// Virtual methods inherited from SourceLineResolverInterface.
- virtual bool LoadModule(const CodeModule *module, const string &map_file);
- virtual bool LoadModuleUsingMapBuffer(const CodeModule *module,
- const string &map_buffer);
- virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module,
- char *memory_buffer,
+ virtual bool LoadModule(const CodeModule* module, const string& map_file);
+ virtual bool LoadModuleUsingMapBuffer(const CodeModule* module,
+ const string& map_buffer);
+ virtual bool LoadModuleUsingMemoryBuffer(const CodeModule* module,
+ char* memory_buffer,
size_t memory_buffer_size);
virtual bool ShouldDeleteMemoryBufferAfterLoadModule();
- virtual void UnloadModule(const CodeModule *module);
- virtual bool HasModule(const CodeModule *module);
- virtual bool IsModuleCorrupt(const CodeModule *module);
- virtual void FillSourceLineInfo(StackFrame *frame);
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame);
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame);
+ virtual void UnloadModule(const CodeModule* module);
+ virtual bool HasModule(const CodeModule* module);
+ virtual bool IsModuleCorrupt(const CodeModule* module);
+ virtual void FillSourceLineInfo(StackFrame* frame);
+ virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame);
+ virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame);
// Nested structs and classes.
struct Line;
struct Function;
struct PublicSymbol;
struct CompareString {
- bool operator()(const string &s1, const string &s2) const;
+ bool operator()(const string& s1, const string& s2) const;
};
// Module is an interface for an in-memory symbol file.
class Module;
@@ -101,18 +101,18 @@ class SourceLineResolverBase : public SourceLineResolverInterface {
// All of the modules that are loaded.
typedef map<string, Module*, CompareString> ModuleMap;
- ModuleMap *modules_;
+ ModuleMap* modules_;
// The loaded modules that were detecting to be corrupt during load.
typedef set<string, CompareString> ModuleSet;
- ModuleSet *corrupt_modules_;
+ ModuleSet* corrupt_modules_;
// All of heap-allocated buffers that are owned locally by resolver.
typedef std::map<string, char*, CompareString> MemoryMap;
- MemoryMap *memory_buffers_;
+ MemoryMap* memory_buffers_;
// Creates a concrete module at run-time.
- ModuleFactory *module_factory_;
+ ModuleFactory* module_factory_;
private:
// ModuleFactory needs to have access to protected type Module.
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_interface.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_interface.h
index a694bf2ea11..990114043b7 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_interface.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/source_line_resolver_interface.h
@@ -58,11 +58,11 @@ class SourceLineResolverInterface {
// and debug_identifier members populated.
//
// map_file should contain line/address mappings for this module.
- virtual bool LoadModule(const CodeModule *module,
- const string &map_file) = 0;
+ virtual bool LoadModule(const CodeModule* module,
+ const string& map_file) = 0;
// Same as above, but takes the contents of a pre-read map buffer
- virtual bool LoadModuleUsingMapBuffer(const CodeModule *module,
- const string &map_buffer) = 0;
+ virtual bool LoadModuleUsingMapBuffer(const CodeModule* module,
+ const string& map_buffer) = 0;
// Add an interface to load symbol using C-String data instead of string.
// This is useful in the optimization design for avoiding unnecessary copying
@@ -70,8 +70,8 @@ class SourceLineResolverInterface {
// LoadModuleUsingMemoryBuffer() does NOT take ownership of memory_buffer.
// LoadModuleUsingMemoryBuffer() null terminates the passed in buffer, if
// the last character is not a null terminator.
- virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module,
- char *memory_buffer,
+ virtual bool LoadModuleUsingMemoryBuffer(const CodeModule* module,
+ char* memory_buffer,
size_t memory_buffer_size) = 0;
// Return true if the memory buffer should be deleted immediately after
@@ -81,31 +81,31 @@ class SourceLineResolverInterface {
// Request that the specified module be unloaded from this resolver.
// A resolver may choose to ignore such a request.
- virtual void UnloadModule(const CodeModule *module) = 0;
+ virtual void UnloadModule(const CodeModule* module) = 0;
// Returns true if the module has been loaded.
- virtual bool HasModule(const CodeModule *module) = 0;
+ virtual bool HasModule(const CodeModule* module) = 0;
// Returns true if the module has been loaded and it is corrupt.
- virtual bool IsModuleCorrupt(const CodeModule *module) = 0;
+ virtual bool IsModuleCorrupt(const CodeModule* module) = 0;
// Fills in the function_base, function_name, source_file_name,
// and source_line fields of the StackFrame. The instruction and
// module_name fields must already be filled in.
- virtual void FillSourceLineInfo(StackFrame *frame) = 0;
+ virtual void FillSourceLineInfo(StackFrame* frame) = 0;
// If Windows stack walking information is available covering
// FRAME's instruction address, return a WindowsFrameInfo structure
// describing it. If the information is not available, returns NULL.
// A NULL return value does not indicate an error. The caller takes
// ownership of any returned WindowsFrameInfo object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) = 0;
+ virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame) = 0;
// If CFI stack walking information is available covering ADDRESS,
// return a CFIFrameInfo structure describing it. If the information
// is not available, return NULL. The caller takes ownership of any
// returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) = 0;
+ virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) = 0;
protected:
// SourceLineResolverInterface cannot be instantiated except by subclasses
diff --git a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/symbol_supplier.h b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/symbol_supplier.h
index a042081f3b1..6ec01766508 100644
--- a/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/symbol_supplier.h
+++ b/chromium/third_party/breakpad/breakpad/src/google_breakpad/processor/symbol_supplier.h
@@ -63,35 +63,35 @@ class SymbolSupplier {
// to help locate the symbol file. system_info may be NULL or its
// fields may be empty if these values are unknown. symbol_file
// must be a pointer to a valid string
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) = 0;
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file) = 0;
// Same as above, except also places symbol data into symbol_data.
// If symbol_data is NULL, the data is not returned.
// TODO(nealsid) Once we have symbol data caching behavior implemented
// investigate making all symbol suppliers implement all methods,
// and make this pure virtual
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) = 0;
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data) = 0;
// Same as above, except allocates data buffer on heap and then places the
// symbol data into the buffer as C-string.
// SymbolSupplier is responsible for deleting the data buffer. After the call
// to GetCStringSymbolData(), the caller should call FreeSymbolData(const
- // Module *module) once the data buffer is no longer needed.
+ // Module* module) once the data buffer is no longer needed.
// If symbol_data is not NULL, symbol supplier won't return FOUND unless it
// returns a valid buffer in symbol_data, e.g., returns INTERRUPT on memory
// allocation failure.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) = 0;
+ virtual SymbolResult GetCStringSymbolData(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size) = 0;
// Frees the data buffer allocated for the module in GetCStringSymbolData.
- virtual void FreeSymbolData(const CodeModule *module) = 0;
+ virtual void FreeSymbolData(const CodeModule* module) = 0;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/address_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/address_map-inl.h
index 251c44781a7..96d955ad7df 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/address_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/address_map-inl.h
@@ -45,8 +45,8 @@
namespace google_breakpad {
template<typename AddressType, typename EntryType>
-bool AddressMap<AddressType, EntryType>::Store(const AddressType &address,
- const EntryType &entry) {
+bool AddressMap<AddressType, EntryType>::Store(const AddressType& address,
+ const EntryType& entry) {
// Ensure that the specified address doesn't conflict with something already
// in the map.
if (map_.find(address) != map_.end()) {
@@ -61,8 +61,8 @@ bool AddressMap<AddressType, EntryType>::Store(const AddressType &address,
template<typename AddressType, typename EntryType>
bool AddressMap<AddressType, EntryType>::Retrieve(
- const AddressType &address,
- EntryType *entry, AddressType *entry_address) const {
+ const AddressType& address,
+ EntryType* entry, AddressType* entry_address) const {
BPLOG_IF(ERROR, !entry) << "AddressMap::Retrieve requires |entry|";
assert(entry);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/address_map.h b/chromium/third_party/breakpad/breakpad/src/processor/address_map.h
index 2972cbb9f87..87321a7f684 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/address_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/address_map.h
@@ -53,15 +53,15 @@ class AddressMap {
// Inserts an entry into the map. Returns false without storing the entry
// if an entry is already stored in the map at the same address as specified
// by the address argument.
- bool Store(const AddressType &address, const EntryType &entry);
+ bool Store(const AddressType& address, const EntryType& entry);
// Locates the entry stored at the highest address less than or equal to
// the address argument. If there is no such range, returns false. The
// entry is returned in entry, which is a required argument. If
// entry_address is not NULL, it will be set to the address that the entry
// was stored at.
- bool Retrieve(const AddressType &address,
- EntryType *entry, AddressType *entry_address) const;
+ bool Retrieve(const AddressType& address,
+ EntryType* entry, AddressType* entry_address) const;
// Empties the address map, restoring it to the same state as when it was
// initially created.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/address_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/address_map_unittest.cc
index 9b4095b16c1..7c85f5ebda6 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/address_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/address_map_unittest.cc
@@ -189,7 +189,7 @@ static bool RunTests() {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
return RunTests() ? 0 : 1;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/basic_code_module.h b/chromium/third_party/breakpad/breakpad/src/processor/basic_code_module.h
index 35d66a6075e..75272897df4 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/basic_code_module.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/basic_code_module.h
@@ -66,11 +66,11 @@ class BasicCodeModule : public CodeModule {
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,
+ 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),
@@ -112,8 +112,8 @@ class BasicCodeModule : public CodeModule {
bool is_unloaded_;
// Disallow copy constructor and assignment operator.
- BasicCodeModule(const BasicCodeModule &that);
- void operator=(const BasicCodeModule &that);
+ BasicCodeModule(const BasicCodeModule& that);
+ void operator=(const BasicCodeModule& that);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/basic_code_modules.h b/chromium/third_party/breakpad/breakpad/src/processor/basic_code_modules.h
index 45ebc53b24f..8c26abb1e05 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/basic_code_modules.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/basic_code_modules.h
@@ -88,8 +88,8 @@ class BasicCodeModules : public CodeModules {
private:
// Disallow copy constructor and assignment operator.
- BasicCodeModules(const BasicCodeModules &that);
- void operator=(const BasicCodeModules &that);
+ BasicCodeModules(const BasicCodeModules& that);
+ void operator=(const BasicCodeModules& that);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver.cc b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver.cc
index c4aa949caa6..64d400156a9 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver.cc
@@ -69,11 +69,11 @@ namespace {
// 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,
+bool TokenizeWithOptionalField(char* line,
+ const char* optional_field,
+ const char* separators,
int max_tokens,
- vector<char*> *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)) {
@@ -98,7 +98,7 @@ bool TokenizeWithOptionalField(char *line,
} // namespace
-static const char *kWhitespace = " \r\n";
+static const char* kWhitespace = " \r\n";
static const int kMaxErrorsPrinted = 5;
static const int kMaxErrorsBeforeBailing = 100;
@@ -107,9 +107,9 @@ BasicSourceLineResolver::BasicSourceLineResolver() :
// static
void BasicSourceLineResolver::Module::LogParseError(
- const string &message,
+ const string& message,
int line_number,
- int *num_errors) {
+ int* num_errors) {
if (++(*num_errors) <= kMaxErrorsPrinted) {
if (line_number > 0) {
BPLOG(ERROR) << "Line " << line_number << ": " << message;
@@ -120,12 +120,12 @@ void BasicSourceLineResolver::Module::LogParseError(
}
bool BasicSourceLineResolver::Module::LoadMapFromMemory(
- char *memory_buffer,
+ char* memory_buffer,
size_t memory_buffer_size) {
linked_ptr<Function> cur_func;
int line_number = 0;
int num_errors = 0;
- char *save_ptr;
+ char* save_ptr;
// If the length is 0, we can still pretend we have a symbol file. This is
// for scenarios that want to test symbol lookup, but don't necessarily care
@@ -160,7 +160,7 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory(
&num_errors);
}
- char *buffer;
+ char* buffer;
buffer = strtok_r(memory_buffer, "\r\n", &save_ptr);
while (buffer != NULL) {
@@ -207,7 +207,7 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory(
LogParseError("Found source line data without a function",
line_number, &num_errors);
} else {
- Line *line = ParseLine(buffer);
+ Line* line = ParseLine(buffer);
if (!line) {
LogParseError("ParseLine failed", line_number, &num_errors);
} else {
@@ -225,7 +225,7 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory(
return true;
}
-void BasicSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
+void BasicSourceLineResolver::Module::LookupAddress(StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
// First, look for a FUNC record that covers address. Use
@@ -264,8 +264,8 @@ void BasicSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
}
}
-WindowsFrameInfo *BasicSourceLineResolver::Module::FindWindowsFrameInfo(
- const StackFrame *frame) const {
+WindowsFrameInfo* BasicSourceLineResolver::Module::FindWindowsFrameInfo(
+ const StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
scoped_ptr<WindowsFrameInfo> result(new WindowsFrameInfo());
@@ -313,8 +313,8 @@ WindowsFrameInfo *BasicSourceLineResolver::Module::FindWindowsFrameInfo(
return NULL;
}
-CFIFrameInfo *BasicSourceLineResolver::Module::FindCFIFrameInfo(
- const StackFrame *frame) const {
+CFIFrameInfo* BasicSourceLineResolver::Module::FindCFIFrameInfo(
+ const StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
MemAddr initial_base, initial_size;
string initial_rules;
@@ -347,9 +347,9 @@ CFIFrameInfo *BasicSourceLineResolver::Module::FindCFIFrameInfo(
return rules.release();
}
-bool BasicSourceLineResolver::Module::ParseFile(char *file_line) {
+bool BasicSourceLineResolver::Module::ParseFile(char* file_line) {
long index;
- char *filename;
+ char* filename;
if (SymbolParseHelper::ParseFile(file_line, &index, &filename)) {
files_.insert(make_pair(index, string(filename)));
return true;
@@ -358,12 +358,12 @@ bool BasicSourceLineResolver::Module::ParseFile(char *file_line) {
}
BasicSourceLineResolver::Function*
-BasicSourceLineResolver::Module::ParseFunction(char *function_line) {
+BasicSourceLineResolver::Module::ParseFunction(char* function_line) {
bool is_multiple;
uint64_t address;
uint64_t size;
long stack_param_size;
- char *name;
+ char* name;
if (SymbolParseHelper::ParseFunction(function_line, &is_multiple, &address,
&size, &stack_param_size, &name)) {
return new Function(name, address, size, stack_param_size, is_multiple);
@@ -372,7 +372,7 @@ BasicSourceLineResolver::Module::ParseFunction(char *function_line) {
}
BasicSourceLineResolver::Line* BasicSourceLineResolver::Module::ParseLine(
- char *line_line) {
+ char* line_line) {
uint64_t address;
uint64_t size;
long line_number;
@@ -385,11 +385,11 @@ BasicSourceLineResolver::Line* BasicSourceLineResolver::Module::ParseLine(
return NULL;
}
-bool BasicSourceLineResolver::Module::ParsePublicSymbol(char *public_line) {
+bool BasicSourceLineResolver::Module::ParsePublicSymbol(char* public_line) {
bool is_multiple;
uint64_t address;
long stack_param_size;
- char *name;
+ char* name;
if (SymbolParseHelper::ParsePublicSymbol(public_line, &is_multiple, &address,
&stack_param_size, &name)) {
@@ -411,7 +411,7 @@ bool BasicSourceLineResolver::Module::ParsePublicSymbol(char *public_line) {
return false;
}
-bool BasicSourceLineResolver::Module::ParseStackInfo(char *stack_info_line) {
+bool BasicSourceLineResolver::Module::ParseStackInfo(char* stack_info_line) {
// Skip "STACK " prefix.
stack_info_line += 6;
@@ -419,7 +419,7 @@ bool BasicSourceLineResolver::Module::ParseStackInfo(char *stack_info_line) {
// information this is.
while (*stack_info_line == ' ')
stack_info_line++;
- const char *platform = stack_info_line;
+ const char* platform = stack_info_line;
while (!strchr(kWhitespace, *stack_info_line))
stack_info_line++;
*stack_info_line++ = '\0';
@@ -468,23 +468,23 @@ bool BasicSourceLineResolver::Module::ParseStackInfo(char *stack_info_line) {
}
bool BasicSourceLineResolver::Module::ParseCFIFrameInfo(
- char *stack_info_line) {
- char *cursor;
+ char* stack_info_line) {
+ char* cursor;
// Is this an INIT record or a delta record?
- char *init_or_address = strtok_r(stack_info_line, " \r\n", &cursor);
+ char* init_or_address = strtok_r(stack_info_line, " \r\n", &cursor);
if (!init_or_address)
return false;
if (strcmp(init_or_address, "INIT") == 0) {
// This record has the form "STACK INIT <address> <size> <rules...>".
- char *address_field = strtok_r(NULL, " \r\n", &cursor);
+ char* address_field = strtok_r(NULL, " \r\n", &cursor);
if (!address_field) return false;
- char *size_field = strtok_r(NULL, " \r\n", &cursor);
+ char* size_field = strtok_r(NULL, " \r\n", &cursor);
if (!size_field) return false;
- char *initial_rules = strtok_r(NULL, "\r\n", &cursor);
+ char* initial_rules = strtok_r(NULL, "\r\n", &cursor);
if (!initial_rules) return false;
MemAddr address = strtoul(address_field, NULL, 16);
@@ -494,8 +494,8 @@ bool BasicSourceLineResolver::Module::ParseCFIFrameInfo(
}
// This record has the form "STACK <address> <rules...>".
- char *address_field = init_or_address;
- char *delta_rules = strtok_r(NULL, "\r\n", &cursor);
+ char* address_field = init_or_address;
+ char* delta_rules = strtok_r(NULL, "\r\n", &cursor);
if (!delta_rules) return false;
MemAddr address = strtoul(address_field, NULL, 16);
cfi_delta_rules_[address] = delta_rules;
@@ -503,8 +503,8 @@ bool BasicSourceLineResolver::Module::ParseCFIFrameInfo(
}
// static
-bool SymbolParseHelper::ParseFile(char *file_line, long *index,
- char **filename) {
+bool SymbolParseHelper::ParseFile(char* file_line, long* index,
+ char** filename) {
// FILE <id> <filename>
assert(strncmp(file_line, "FILE ", 5) == 0);
file_line += 5; // skip prefix
@@ -514,7 +514,7 @@ bool SymbolParseHelper::ParseFile(char *file_line, long *index,
return false;
}
- char *after_number;
+ char* after_number;
*index = strtol(tokens[0], &after_number, 10);
if (!IsValidAfterNumber(after_number) || *index < 0 ||
*index == std::numeric_limits<long>::max()) {
@@ -530,9 +530,9 @@ bool SymbolParseHelper::ParseFile(char *file_line, long *index,
}
// static
-bool SymbolParseHelper::ParseFunction(char *function_line, bool *is_multiple,
- uint64_t *address, uint64_t *size,
- long *stack_param_size, char **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
@@ -545,7 +545,7 @@ bool SymbolParseHelper::ParseFunction(char *function_line, bool *is_multiple,
*is_multiple = strcmp(tokens[0], "m") == 0;
int next_token = *is_multiple ? 1 : 0;
- char *after_number;
+ char* after_number;
*address = strtoull(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*address == std::numeric_limits<unsigned long long>::max()) {
@@ -568,16 +568,16 @@ bool SymbolParseHelper::ParseFunction(char *function_line, bool *is_multiple,
}
// static
-bool SymbolParseHelper::ParseLine(char *line_line, uint64_t *address,
- uint64_t *size, long *line_number,
- long *source_file) {
+bool SymbolParseHelper::ParseLine(char* line_line, uint64_t* address,
+ uint64_t* size, long* line_number,
+ long* source_file) {
// <address> <size> <line number> <source file id>
vector<char*> tokens;
if (!Tokenize(line_line, kWhitespace, 4, &tokens)) {
return false;
}
- char *after_number;
+ char* after_number;
*address = strtoull(tokens[0], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*address == std::numeric_limits<unsigned long long>::max()) {
@@ -613,10 +613,10 @@ bool SymbolParseHelper::ParseLine(char *line_line, uint64_t *address,
}
// static
-bool SymbolParseHelper::ParsePublicSymbol(char *public_line, bool *is_multiple,
- uint64_t *address,
- long *stack_param_size,
- char **name) {
+bool SymbolParseHelper::ParsePublicSymbol(char* public_line, bool* is_multiple,
+ uint64_t* address,
+ long* stack_param_size,
+ char** name) {
// PUBLIC [<multiple>] <address> <stack_param_size> <name>
assert(strncmp(public_line, "PUBLIC ", 7) == 0);
public_line += 7; // skip prefix
@@ -629,7 +629,7 @@ bool SymbolParseHelper::ParsePublicSymbol(char *public_line, bool *is_multiple,
*is_multiple = strcmp(tokens[0], "m") == 0;
int next_token = *is_multiple ? 1 : 0;
- char *after_number;
+ char* after_number;
*address = strtoull(tokens[next_token++], &after_number, 16);
if (!IsValidAfterNumber(after_number) ||
*address == std::numeric_limits<unsigned long long>::max()) {
@@ -647,7 +647,7 @@ bool SymbolParseHelper::ParsePublicSymbol(char *public_line, bool *is_multiple,
}
// static
-bool SymbolParseHelper::IsValidAfterNumber(char *after_number) {
+bool SymbolParseHelper::IsValidAfterNumber(char* after_number) {
if (after_number != NULL && strchr(kWhitespace, *after_number) != NULL) {
return true;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_types.h b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_types.h
index 89eb57e88a5..c103040ddea 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_types.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_types.h
@@ -57,7 +57,7 @@ namespace google_breakpad {
struct
BasicSourceLineResolver::Function : public SourceLineResolverBase::Function {
- Function(const string &function_name,
+ Function(const string& function_name,
MemAddr function_address,
MemAddr code_size,
int set_parameter_size,
@@ -75,7 +75,7 @@ BasicSourceLineResolver::Function : public SourceLineResolverBase::Function {
class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module {
public:
- explicit Module(const string &name) : name_(name), is_corrupt_(false) { }
+ explicit Module(const string& name) : name_(name), is_corrupt_(false) { }
virtual ~Module() { }
// Loads a map from the given buffer in char* type.
@@ -83,7 +83,7 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module {
// The passed in |memory buffer| is of size |memory_buffer_size|. If it is
// not null terminated, LoadMapFromMemory() will null terminate it by
// modifying the passed in buffer.
- virtual bool LoadMapFromMemory(char *memory_buffer,
+ virtual bool LoadMapFromMemory(char* memory_buffer,
size_t memory_buffer_size);
// Tells whether the loaded symbol data is corrupt. Return value is
@@ -92,20 +92,20 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module {
// Looks up the given relative address, and fills the StackFrame struct
// with the result.
- virtual void LookupAddress(StackFrame *frame) const;
+ virtual void LookupAddress(StackFrame* frame) const;
// If Windows stack walking information is available covering ADDRESS,
// return a WindowsFrameInfo structure describing it. If the information
// is not available, returns NULL. A NULL return value does not indicate
// an error. The caller takes ownership of any returned WindowsFrameInfo
// object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) const;
+ virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame) const;
// If CFI stack walking information is available covering ADDRESS,
// return a CFIFrameInfo structure describing it. If the information
// is not available, return NULL. The caller takes ownership of any
// returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const;
+ virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) const;
private:
// Friend declarations.
@@ -118,29 +118,29 @@ class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module {
// Logs parse errors. |*num_errors| is increased every time LogParseError is
// called.
static void LogParseError(
- const string &message,
+ const string& message,
int line_number,
- int *num_errors);
+ int* num_errors);
// Parses a file declaration
- bool ParseFile(char *file_line);
+ bool ParseFile(char* file_line);
// Parses a function declaration, returning a new Function object.
- Function* ParseFunction(char *function_line);
+ Function* ParseFunction(char* function_line);
// Parses a line declaration, returning a new Line object.
- Line* ParseLine(char *line_line);
+ Line* ParseLine(char* line_line);
// Parses a PUBLIC symbol declaration, storing it in public_symbols_.
// Returns false if an error occurs.
- bool ParsePublicSymbol(char *public_line);
+ bool ParsePublicSymbol(char* public_line);
// Parses a STACK WIN or STACK CFI frame info declaration, storing
// it in the appropriate table.
- bool ParseStackInfo(char *stack_info_line);
+ bool ParseStackInfo(char* stack_info_line);
// Parses a STACK CFI record, storing it in cfi_frame_info_.
- bool ParseCFIFrameInfo(char *stack_info_line);
+ bool ParseCFIFrameInfo(char* stack_info_line);
string name_;
FileMap files_;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_unittest.cc
index 90c34172368..2cb2967caa4 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/basic_source_line_resolver_unittest.cc
@@ -83,15 +83,15 @@ class TestCodeModule : public CodeModule {
class MockMemoryRegion: public MemoryRegion {
uint64_t GetBase() const { return 0x10000; }
uint32_t GetSize() const { return 0x01000; }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
*value = address & 0xff;
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
*value = address & 0xffff;
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
switch (address) {
case 0x10008: *value = 0x98ecadc3; break; // saved %ebx
case 0x1000c: *value = 0x878f7524; break; // saved %esi
@@ -102,7 +102,7 @@ class MockMemoryRegion: public MemoryRegion {
}
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
*value = address;
return true;
}
@@ -116,9 +116,9 @@ class MockMemoryRegion: public MemoryRegion {
// EXPECTED's.) Also verify that ACTUAL has associations for ".ra" and
// ".cfa".
static bool VerifyRegisters(
- const char *file, int line,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &expected,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &actual) {
+ const char* file, int line,
+ const CFIFrameInfo::RegisterValueMap<uint32_t>& expected,
+ const CFIFrameInfo::RegisterValueMap<uint32_t>& actual) {
CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator a;
a = actual.find(".cfa");
if (a == actual.end())
@@ -148,7 +148,7 @@ static bool VerifyRegisters(
}
-static bool VerifyEmpty(const StackFrame &frame) {
+static bool VerifyEmpty(const StackFrame& frame) {
if (frame.function_name.empty() &&
frame.source_file_name.empty() &&
frame.source_line == 0)
@@ -156,7 +156,7 @@ static bool VerifyEmpty(const StackFrame &frame) {
return false;
}
-static void ClearSourceLineInfo(StackFrame *frame) {
+static void ClearSourceLineInfo(StackFrame* frame) {
frame->function_name.clear();
frame->module = NULL;
frame->source_file_name.clear();
@@ -417,7 +417,7 @@ TEST_F(TestBasicSourceLineResolver, TestUnload)
// FILE <id> <filename>
TEST(SymbolParseHelper, ParseFileValid) {
long index;
- char *filename;
+ char* filename;
char kTestLine[] = "FILE 1 file name";
ASSERT_TRUE(SymbolParseHelper::ParseFile(kTestLine, &index, &filename));
@@ -435,7 +435,7 @@ TEST(SymbolParseHelper, ParseFileValid) {
// FILE <id> <filename>
TEST(SymbolParseHelper, ParseFileInvalid) {
long index;
- char *filename;
+ char* filename;
// Test missing file name.
char kTestLine[] = "FILE 1 ";
@@ -461,7 +461,7 @@ TEST(SymbolParseHelper, ParseFunctionValid) {
uint64_t address;
uint64_t size;
long stack_param_size;
- char *name;
+ char* name;
char kTestLine[] = "FUNC 1 2 3 function name";
ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine, &multiple, &address,
@@ -513,7 +513,7 @@ TEST(SymbolParseHelper, ParseFunctionInvalid) {
uint64_t address;
uint64_t size;
long stack_param_size;
- char *name;
+ char* name;
// Test missing function name.
char kTestLine[] = "FUNC 1 2 3 ";
@@ -649,7 +649,7 @@ TEST(SymbolParseHelper, ParsePublicSymbolValid) {
bool multiple;
uint64_t address;
long stack_param_size;
- char *name;
+ char* name;
char kTestLine[] = "PUBLIC 1 2 3";
ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &multiple,
@@ -697,7 +697,7 @@ TEST(SymbolParseHelper, ParsePublicSymbolInvalid) {
bool multiple;
uint64_t address;
long stack_param_size;
- char *name;
+ char* name;
// Test missing source function name.
char kTestLine[] = "PUBLIC 1 2 ";
@@ -738,7 +738,7 @@ TEST(SymbolParseHelper, ParsePublicSymbolInvalid) {
} // namespace
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/call_stack.cc b/chromium/third_party/breakpad/breakpad/src/processor/call_stack.cc
index 925f084690a..f219e843168 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/call_stack.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/call_stack.cc
@@ -43,7 +43,7 @@ CallStack::~CallStack() {
}
void CallStack::Clear() {
- for (vector<StackFrame *>::const_iterator iterator = frames_.begin();
+ for (vector<StackFrame*>::const_iterator iterator = frames_.begin();
iterator != frames_.end();
++iterator) {
delete *iterator;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info-inl.h
index 7e7af0af93a..52d2f5fc780 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info-inl.h
@@ -42,12 +42,12 @@ namespace google_breakpad {
template <typename RegisterType, class RawContextType>
bool SimpleCFIWalker<RegisterType, RawContextType>::FindCallerRegisters(
- const MemoryRegion &memory,
- const CFIFrameInfo &cfi_frame_info,
- const RawContextType &callee_context,
+ const MemoryRegion& memory,
+ const CFIFrameInfo& cfi_frame_info,
+ const RawContextType& callee_context,
int callee_validity,
- RawContextType *caller_context,
- int *caller_validity) const {
+ RawContextType* caller_context,
+ int* caller_validity) const {
typedef CFIFrameInfo::RegisterValueMap<RegisterType> ValueMap;
ValueMap callee_registers;
ValueMap caller_registers;
@@ -56,7 +56,7 @@ bool SimpleCFIWalker<RegisterType, RawContextType>::FindCallerRegisters(
// Populate callee_registers with register values from callee_context.
for (size_t i = 0; i < map_size_; i++) {
- const RegisterSet &r = register_map_[i];
+ const RegisterSet& r = register_map_[i];
if (callee_validity & r.validity_flag)
callee_registers[r.name] = callee_context.*r.context_member;
}
@@ -71,7 +71,7 @@ bool SimpleCFIWalker<RegisterType, RawContextType>::FindCallerRegisters(
memset(caller_context, 0xda, sizeof(*caller_context));
*caller_validity = 0;
for (size_t i = 0; i < map_size_; i++) {
- const RegisterSet &r = register_map_[i];
+ const RegisterSet& r = register_map_[i];
typename ValueMap::const_iterator caller_entry;
// Did the rules provide a value for this register by its name?
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.cc b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.cc
index 0c4af7ba843..280620f23db 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.cc
@@ -48,9 +48,9 @@ namespace google_breakpad {
#endif
template<typename V>
-bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap<V> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<V> *caller_registers) const {
+bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap<V>& registers,
+ const MemoryRegion& memory,
+ RegisterValueMap<V>* caller_registers) const {
// If there are not rules for both .ra and .cfa in effect at this address,
// don't use this CFI data for stack walking.
if (cfa_rule_.empty() || ra_rule_.empty())
@@ -93,13 +93,13 @@ bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap<V> &registers,
// Explicit instantiations for 32-bit and 64-bit architectures.
template bool CFIFrameInfo::FindCallerRegs<uint32_t>(
- const RegisterValueMap<uint32_t> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<uint32_t> *caller_registers) const;
+ const RegisterValueMap<uint32_t>& registers,
+ const MemoryRegion& memory,
+ RegisterValueMap<uint32_t>* caller_registers) const;
template bool CFIFrameInfo::FindCallerRegs<uint64_t>(
- const RegisterValueMap<uint64_t> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<uint64_t> *caller_registers) const;
+ const RegisterValueMap<uint64_t>& registers,
+ const MemoryRegion& memory,
+ RegisterValueMap<uint64_t>* caller_registers) const;
string CFIFrameInfo::Serialize() const {
std::ostringstream stream;
@@ -123,7 +123,7 @@ string CFIFrameInfo::Serialize() const {
return stream.str();
}
-bool CFIRuleParser::Parse(const string &rule_set) {
+bool CFIRuleParser::Parse(const string& rule_set) {
size_t rule_set_len = rule_set.size();
scoped_array<char> working_copy(new char[rule_set_len + 1]);
memcpy(working_copy.get(), rule_set.data(), rule_set_len);
@@ -132,9 +132,9 @@ bool CFIRuleParser::Parse(const string &rule_set) {
name_.clear();
expression_.clear();
- char *cursor;
+ char* cursor;
static const char token_breaks[] = " \t\r\n";
- char *token = strtok_r(working_copy.get(), token_breaks, &cursor);
+ char* token = strtok_r(working_copy.get(), token_breaks, &cursor);
for (;;) {
// End of rule set?
@@ -170,16 +170,16 @@ bool CFIRuleParser::Report() {
return true;
}
-void CFIFrameInfoParseHandler::CFARule(const string &expression) {
+void CFIFrameInfoParseHandler::CFARule(const string& expression) {
frame_info_->SetCFARule(expression);
}
-void CFIFrameInfoParseHandler::RARule(const string &expression) {
+void CFIFrameInfoParseHandler::RARule(const string& expression) {
frame_info_->SetRARule(expression);
}
-void CFIFrameInfoParseHandler::RegisterRule(const string &name,
- const string &expression) {
+void CFIFrameInfoParseHandler::RegisterRule(const string& name,
+ const string& expression) {
frame_info_->SetRegisterRule(name, expression);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.h b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.h
index 90a1b3d74a9..2bc93336073 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info.h
@@ -72,9 +72,9 @@ class CFIFrameInfo {
// Set the expression for computing a call frame address, return
// address, or register's value. At least the CFA rule and the RA
// rule must be set before calling FindCallerRegs.
- void SetCFARule(const string &expression) { cfa_rule_ = expression; }
- void SetRARule(const string &expression) { ra_rule_ = expression; }
- void SetRegisterRule(const string &register_name, const string &expression) {
+ void SetCFARule(const string& expression) { cfa_rule_ = expression; }
+ void SetRARule(const string& expression) { ra_rule_ = expression; }
+ void SetRegisterRule(const string& register_name, const string& expression) {
register_rules_[register_name] = expression;
}
@@ -96,9 +96,9 @@ class CFIFrameInfo {
// These may be helpful in computing the caller's PC and stack
// pointer, if their values are not explicitly specified.
template<typename ValueType>
- bool FindCallerRegs(const RegisterValueMap<ValueType> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<ValueType> *caller_registers) const;
+ bool FindCallerRegs(const RegisterValueMap<ValueType>& registers,
+ const MemoryRegion& memory,
+ RegisterValueMap<ValueType>* caller_registers) const;
// Serialize the rules in this object into a string in the format
// of STACK CFI records.
@@ -148,28 +148,28 @@ class CFIRuleParser {
virtual ~Handler() { }
// The input specifies EXPRESSION as the CFA/RA computation rule.
- virtual void CFARule(const string &expression) = 0;
- virtual void RARule(const string &expression) = 0;
+ virtual void CFARule(const string& expression) = 0;
+ virtual void RARule(const string& expression) = 0;
// The input specifies EXPRESSION as the recovery rule for register NAME.
- virtual void RegisterRule(const string &name, const string &expression) = 0;
+ virtual void RegisterRule(const string& name, const string& expression) = 0;
};
// Construct a parser which feeds its results to HANDLER.
- CFIRuleParser(Handler *handler) : handler_(handler) { }
+ CFIRuleParser(Handler* handler) : handler_(handler) { }
// Parse RULE_SET as a set of CFA computation and RA/register
// recovery rules, as appearing in STACK CFI records. Report the
// results of parsing by making the appropriate calls to handler_.
// Return true if parsing was successful, false otherwise.
- bool Parse(const string &rule_set);
+ bool Parse(const string& rule_set);
private:
// Report any accumulated rule to handler_
bool Report();
// The handler to which the parser reports its findings.
- Handler *handler_;
+ Handler* handler_;
// Working data.
string name_, expression_;
@@ -180,15 +180,15 @@ class CFIRuleParser {
class CFIFrameInfoParseHandler: public CFIRuleParser::Handler {
public:
// Populate FRAME_INFO with the results of parsing.
- CFIFrameInfoParseHandler(CFIFrameInfo *frame_info)
+ CFIFrameInfoParseHandler(CFIFrameInfo* frame_info)
: frame_info_(frame_info) { }
- void CFARule(const string &expression);
- void RARule(const string &expression);
- void RegisterRule(const string &name, const string &expression);
+ void CFARule(const string& expression);
+ void RARule(const string& expression);
+ void RegisterRule(const string& name, const string& expression);
private:
- CFIFrameInfo *frame_info_;
+ CFIFrameInfo* frame_info_;
};
// A utility class template for simple 'STACK CFI'-driven stack walkers.
@@ -212,14 +212,14 @@ class SimpleCFIWalker {
// A structure describing one architecture register.
struct RegisterSet {
// The register name, as it appears in STACK CFI rules.
- const char *name;
+ const char* name;
// An alternate name that the register's value might be found
// under in a register value dictionary, or NULL. When generating
// names, prefer NAME to this value. It's common to list ".cfa" as
// an alternative name for the stack pointer, and ".ra" as an
// alternative name for the instruction pointer.
- const char *alternate_name;
+ const char* alternate_name;
// True if the callee is expected to preserve the value of this
// register. If this flag is true for some register R, and the STACK
@@ -240,7 +240,7 @@ class SimpleCFIWalker {
// architecture's register set. REGISTER_MAP is an array of
// RegisterSet structures; MAP_SIZE is the number of elements in the
// array.
- SimpleCFIWalker(const RegisterSet *register_map, size_t map_size)
+ SimpleCFIWalker(const RegisterSet* register_map, size_t map_size)
: register_map_(register_map), map_size_(map_size) { }
// Compute the calling frame's raw context given the callee's raw
@@ -256,15 +256,15 @@ class SimpleCFIWalker {
// fill in CALLER_CONTEXT with the caller's register values, and set
// CALLER_VALIDITY to indicate which registers are valid in
// CALLER_CONTEXT. Return true on success, or false on failure.
- bool FindCallerRegisters(const MemoryRegion &memory,
- const CFIFrameInfo &cfi_frame_info,
- const RawContextType &callee_context,
+ bool FindCallerRegisters(const MemoryRegion& memory,
+ const CFIFrameInfo& cfi_frame_info,
+ const RawContextType& callee_context,
int callee_validity,
- RawContextType *caller_context,
- int *caller_validity) const;
+ RawContextType* caller_context,
+ int* caller_validity) const;
private:
- const RegisterSet *register_map_;
+ const RegisterSet* register_map_;
size_t map_size_;
};
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info_unittest.cc
index 542b28492ee..8111437a6c8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/cfi_frame_info_unittest.cc
@@ -56,10 +56,10 @@ class MockMemoryRegion: public MemoryRegion {
public:
MOCK_CONST_METHOD0(GetBase, uint64_t());
MOCK_CONST_METHOD0(GetSize, uint32_t());
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint8_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint16_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint32_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint64_t *));
+ MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint8_t*));
+ MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint16_t*));
+ MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint32_t*));
+ MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint64_t*));
MOCK_CONST_METHOD0(Print, void());
};
@@ -70,10 +70,10 @@ struct CFIFixture {
void ExpectNoMemoryReferences() {
EXPECT_CALL(memory, GetBase()).Times(0);
EXPECT_CALL(memory, GetSize()).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint8_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint16_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint32_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint64_t *>())).Times(0);
+ EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint8_t*>())).Times(0);
+ EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint16_t*>())).Times(0);
+ EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint32_t*>())).Times(0);
+ EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint64_t*>())).Times(0);
}
CFIFrameInfo cfi;
@@ -292,9 +292,9 @@ TEST_F(Scope, SeparateTempsRA) {
class MockCFIRuleParserHandler: public CFIRuleParser::Handler {
public:
- MOCK_METHOD1(CFARule, void(const string &));
- MOCK_METHOD1(RARule, void(const string &));
- MOCK_METHOD2(RegisterRule, void(const string &, const string &));
+ MOCK_METHOD1(CFARule, void(const string&));
+ MOCK_METHOD1(RARule, void(const string&));
+ MOCK_METHOD2(RegisterRule, void(const string&, const string&));
};
// A fixture class for testing CFIRuleParser.
@@ -509,12 +509,12 @@ TEST_F(SimpleWalker, Walk) {
// Saved r0.
EXPECT_CALL(memory,
- GetMemoryAtAddress(stack_top, A<uint64_t *>()))
+ GetMemoryAtAddress(stack_top, A<uint64_t*>()))
.WillRepeatedly(DoAll(SetArgumentPointee<1>(0xdc1975eba8602302ULL),
Return(true)));
// Saved return address.
EXPECT_CALL(memory,
- GetMemoryAtAddress(stack_top + 16, A<uint64_t *>()))
+ GetMemoryAtAddress(stack_top + 16, A<uint64_t*>()))
.WillRepeatedly(DoAll(SetArgumentPointee<1>(0xba5ad6d9acce28deULL),
Return(true)));
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map-inl.h
index 4c0ad41f947..edd11d7cfd0 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map-inl.h
@@ -55,7 +55,7 @@ ContainedRangeMap<AddressType, EntryType>::~ContainedRangeMap() {
template<typename AddressType, typename EntryType>
bool ContainedRangeMap<AddressType, EntryType>::StoreRange(
- const AddressType &base, const AddressType &size, const EntryType &entry) {
+ const AddressType& base, const AddressType& size, const EntryType& entry) {
AddressType high = base + size - 1;
// Check for undersize or overflow.
@@ -125,7 +125,7 @@ bool ContainedRangeMap<AddressType, EntryType>::StoreRange(
// Optimization: if the iterators are equal, no child ranges would be
// moved. Create the new child range with a NULL map to conserve space
// in leaf nodes, of which there will be many.
- AddressToRangeMap *child_map = NULL;
+ AddressToRangeMap* child_map = NULL;
if (iterator_base != iterator_high) {
// The children of this range that are contained by the new range must
@@ -149,7 +149,7 @@ bool ContainedRangeMap<AddressType, EntryType>::StoreRange(
template<typename AddressType, typename EntryType>
bool ContainedRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, EntryType *entry) const {
+ const AddressType& address, EntryType* entry) const {
BPLOG_IF(ERROR, !entry) << "ContainedRangeMap::RetrieveRange requires "
"|entry|";
assert(entry);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map.h b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map.h
index 1015ae8cfd2..18d03af7ac8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map.h
@@ -86,16 +86,16 @@ class ContainedRangeMap {
// grandchildren of this ContainedRangeMap. Returns false for a
// parameter error, or if the ContainedRangeMap hierarchy guarantees
// would be violated.
- bool StoreRange(const AddressType &base,
- const AddressType &size,
- const EntryType &entry);
+ bool StoreRange(const AddressType& base,
+ const AddressType& size,
+ const EntryType& entry);
// Retrieves the most specific (smallest) descendant range encompassing
// the specified address. This method will only return entries held by
// child ranges, and not the entry contained by |this|. This is necessary
// to support a sparsely-populated root range. If no descendant range
// encompasses the address, returns false.
- bool RetrieveRange(const AddressType &address, EntryType *entry) const;
+ bool RetrieveRange(const AddressType& address, EntryType* entry) const;
// Removes all children. Note that Clear only removes descendants,
// leaving the node on which it is called intact. Because the only
@@ -110,7 +110,7 @@ class ContainedRangeMap {
// AddressToRangeMap stores pointers. This makes reparenting simpler in
// StoreRange, because it doesn't need to copy entire objects.
- typedef std::map<AddressType, ContainedRangeMap *> AddressToRangeMap;
+ typedef std::map<AddressType, ContainedRangeMap*> AddressToRangeMap;
typedef typename AddressToRangeMap::const_iterator MapConstIterator;
typedef typename AddressToRangeMap::iterator MapIterator;
typedef typename AddressToRangeMap::value_type MapValue;
@@ -118,8 +118,8 @@ class ContainedRangeMap {
// Creates a new ContainedRangeMap with the specified base address, entry,
// and initial child map, which may be NULL. This is only used internally
// by ContainedRangeMap when it creates a new child.
- ContainedRangeMap(const AddressType &base, const EntryType &entry,
- AddressToRangeMap *map)
+ ContainedRangeMap(const AddressType& base, const EntryType& entry,
+ AddressToRangeMap* map)
: base_(base), entry_(entry), map_(map) {}
// The base address of this range. The high address does not need to
@@ -140,7 +140,7 @@ class ContainedRangeMap {
// The map containing child ranges, keyed by each child range's high
// address. This is a pointer to avoid allocating map structures for
// leaf nodes, where they are not needed.
- AddressToRangeMap *map_;
+ AddressToRangeMap* map_;
};
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map_unittest.cc
index e5910da0d5d..a97c5d0f90e 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/contained_range_map_unittest.cc
@@ -256,7 +256,7 @@ static bool RunTests() {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
return RunTests() ? 0 : 1;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.cc b/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.cc
index 559022404f6..012676785ee 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.cc
@@ -30,7 +30,7 @@
namespace google_breakpad {
-DisassemblerX86::DisassemblerX86(const uint8_t *bytecode,
+DisassemblerX86::DisassemblerX86(const uint8_t* bytecode,
uint32_t size,
uint32_t virtual_address) :
bytecode_(bytecode),
@@ -62,7 +62,7 @@ uint32_t DisassemblerX86::NextInstruction() {
return 0;
}
uint32_t instr_size = 0;
- instr_size = libdis::x86_disasm((unsigned char *)bytecode_, size_,
+ instr_size = libdis::x86_disasm((unsigned char*)bytecode_, size_,
virtual_address_, current_byte_offset_,
&current_instr_);
if (instr_size == 0) {
@@ -78,8 +78,8 @@ uint32_t DisassemblerX86::NextInstruction() {
if (current_instr_.type == libdis::insn_return)
end_of_block_ = true;
- libdis::x86_op_t *src = libdis::x86_get_src_operand(&current_instr_);
- libdis::x86_op_t *dest = libdis::x86_get_dest_operand(&current_instr_);
+ libdis::x86_op_t* src = libdis::x86_get_src_operand(&current_instr_);
+ libdis::x86_op_t* dest = libdis::x86_get_dest_operand(&current_instr_);
if (register_valid_) {
switch (current_instr_.group) {
@@ -213,7 +213,7 @@ bool DisassemblerX86::setBadRead() {
if (!instr_valid_)
return false;
- libdis::x86_op_t *operand = libdis::x86_get_src_operand(&current_instr_);
+ libdis::x86_op_t* operand = libdis::x86_get_src_operand(&current_instr_);
if (!operand || operand->type != libdis::op_expression)
return false;
@@ -227,7 +227,7 @@ bool DisassemblerX86::setBadWrite() {
if (!instr_valid_)
return false;
- libdis::x86_op_t *operand = libdis::x86_get_dest_operand(&current_instr_);
+ libdis::x86_op_t* operand = libdis::x86_get_dest_operand(&current_instr_);
if (!operand || operand->type != libdis::op_expression)
return false;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.h b/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.h
index 71069410721..ca65b6e896e 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/disassembler_x86.h
@@ -63,7 +63,7 @@ class DisassemblerX86 {
// TODO(cdn): Modify this class to take a MemoryRegion instead of just
// a raw buffer. This will make it easier to use this on arbitrary
// minidumps without first copying out the code segment.
- DisassemblerX86(const uint8_t *bytecode, uint32_t, uint32_t);
+ DisassemblerX86(const uint8_t* bytecode, uint32_t, uint32_t);
~DisassemblerX86();
// This walks to the next instruction in the memory region and
@@ -102,7 +102,7 @@ class DisassemblerX86 {
bool setBadWrite();
protected:
- const uint8_t *bytecode_;
+ const uint8_t* bytecode_;
uint32_t size_;
uint32_t virtual_address_;
uint32_t current_byte_offset_;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
index ccc9f1459cc..798056dfa9f 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
@@ -77,13 +77,13 @@ const unsigned int MAX_OBJDUMP_BUFFER_LEN = 4096;
namespace google_breakpad {
-ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state)
+ExploitabilityLinux::ExploitabilityLinux(Minidump* dump,
+ ProcessState* process_state)
: Exploitability(dump, process_state),
enable_objdump_(false) { }
-ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state,
+ExploitabilityLinux::ExploitabilityLinux(Minidump* dump,
+ ProcessState* process_state,
bool enable_objdump)
: Exploitability(dump, process_state),
enable_objdump_(enable_objdump) { }
@@ -111,12 +111,12 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
}
// Getting exception data. (It should exist for all minidumps.)
- MinidumpException *exception = dump_->GetException();
+ MinidumpException* exception = dump_->GetException();
if (exception == NULL) {
BPLOG(INFO) << "No exception record.";
return EXPLOITABILITY_ERR_PROCESSING;
}
- const MDRawExceptionStream *raw_exception_stream = exception->exception();
+ const MDRawExceptionStream* raw_exception_stream = exception->exception();
if (raw_exception_stream == NULL) {
BPLOG(INFO) << "No raw exception stream.";
return EXPLOITABILITY_ERR_PROCESSING;
@@ -132,7 +132,7 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
uint64_t instruction_ptr = 0;
uint64_t stack_ptr = 0;
- const MinidumpContext *context = exception->GetContext();
+ const MinidumpContext* context = exception->GetContext();
if (context == NULL) {
BPLOG(INFO) << "No exception context.";
return EXPLOITABILITY_ERR_PROCESSING;
@@ -174,8 +174,8 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
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 =
+ MinidumpMemoryList* memory_list = dump_->GetMemoryList();
+ MinidumpMemoryRegion* memory_region =
memory_list ?
memory_list->GetMemoryRegionForAddress(instruction_ptr) : NULL;
if (!memory_region) {
@@ -185,15 +185,15 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
// Get exception data to find architecture.
string architecture = "";
- MinidumpException *exception = dump_->GetException();
+ 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();
+ 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.";
@@ -217,7 +217,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
// 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 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.";
@@ -275,9 +275,9 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
}
#ifndef _WIN32
-bool ExploitabilityLinux::CalculateAddress(const string &address_expression,
- const DumpContext &context,
- uint64_t *write_address) {
+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
@@ -395,8 +395,8 @@ bool ExploitabilityLinux::CalculateAddress(const string &address_expression,
// static
bool ExploitabilityLinux::GetObjdumpInstructionLine(
- const char *objdump_output_buffer,
- string *instruction_line) {
+ 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));
@@ -420,10 +420,10 @@ bool ExploitabilityLinux::GetObjdumpInstructionLine(
return true;
}
-bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string &line,
- string *operation,
- string *dest,
- string *src) {
+bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string& line,
+ string* operation,
+ string* dest,
+ string* src) {
if (!operation || !dest || !src) {
BPLOG(ERROR) << "Null parameters passed.";
return false;
@@ -483,10 +483,10 @@ bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string &line,
return true;
}
-bool ExploitabilityLinux::DisassembleBytes(const string &architecture,
- const uint8_t *raw_bytes,
+bool ExploitabilityLinux::DisassembleBytes(const string& architecture,
+ const uint8_t* raw_bytes,
const unsigned int buffer_len,
- char *objdump_output_buffer) {
+ char* objdump_output_buffer) {
if (!raw_bytes || !objdump_output_buffer) {
BPLOG(ERROR) << "Bad input parameters.";
return false;
@@ -514,7 +514,7 @@ bool ExploitabilityLinux::DisassembleBytes(const string &architecture,
"objdump -D -b binary -M intel -m %s %s",
architecture.c_str(),
raw_bytes_tmpfile);
- FILE *objdump_fp = popen(cmd, "r");
+ FILE* objdump_fp = popen(cmd, "r");
if (!objdump_fp) {
fclose(objdump_fp);
unlink(raw_bytes_tmpfile);
@@ -534,12 +534,12 @@ bool ExploitabilityLinux::DisassembleBytes(const string &architecture,
#endif // _WIN32
bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) {
- MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
+ MinidumpLinuxMapsList* linux_maps_list = dump_->GetLinuxMapsList();
// Inconclusive if there are no mappings available.
if (!linux_maps_list) {
return false;
}
- const MinidumpLinuxMaps *linux_maps =
+ 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
@@ -550,10 +550,10 @@ bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) {
}
bool ExploitabilityLinux::ExecutableStackOrHeap() {
- MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
+ 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 =
+ 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(
@@ -574,15 +574,15 @@ bool ExploitabilityLinux::InstructionPointerInCode(uint64_t instruction_ptr) {
// 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 =
+ 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) {
+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.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.h b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.h
index e3ff13b6e07..36647959104 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.h
@@ -44,8 +44,8 @@ namespace google_breakpad {
class ExploitabilityLinux : public Exploitability {
public:
- ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state);
+ ExploitabilityLinux(Minidump* dump,
+ ProcessState* process_state);
// Parameters are the minidump to analyze, the object representing process
// state, and whether to enable objdump disassembly.
@@ -53,8 +53,8 @@ class ExploitabilityLinux : public Exploitability {
// 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,
+ ExploitabilityLinux(Minidump* dump,
+ ProcessState* process_state,
bool enable_objdump);
virtual ExploitabilityRating CheckPlatformExploitability();
@@ -68,7 +68,7 @@ class ExploitabilityLinux : public Exploitability {
// 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);
+ 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
@@ -81,34 +81,34 @@ class ExploitabilityLinux : public Exploitability {
// 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,
+ static bool DisassembleBytes(const string& architecture,
+ const uint8_t* raw_bytes,
const unsigned int MAX_OBJDUMP_BUFFER_LEN,
- char *objdump_output_buffer);
+ 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);
+ 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);
+ 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);
+ 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
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_win.cc b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_win.cc
index a1f8703a6ef..b74a7496597 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/exploitability_win.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/exploitability_win.cc
@@ -69,30 +69,30 @@ static const size_t kHugeBump = 90;
// The maximum number of bytes to disassemble past the program counter.
static const size_t kDisassembleBytesBeyondPC = 2048;
-ExploitabilityWin::ExploitabilityWin(Minidump *dump,
- ProcessState *process_state)
+ExploitabilityWin::ExploitabilityWin(Minidump* dump,
+ ProcessState* process_state)
: Exploitability(dump, process_state) { }
ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
- MinidumpException *exception = dump_->GetException();
+ MinidumpException* exception = dump_->GetException();
if (!exception) {
BPLOG(INFO) << "Minidump does not have exception record.";
return EXPLOITABILITY_ERR_PROCESSING;
}
- const MDRawExceptionStream *raw_exception = exception->exception();
+ const MDRawExceptionStream* raw_exception = exception->exception();
if (!raw_exception) {
BPLOG(INFO) << "Could not obtain raw exception info.";
return EXPLOITABILITY_ERR_PROCESSING;
}
- const MinidumpContext *context = exception->GetContext();
+ const MinidumpContext* context = exception->GetContext();
if (!context) {
BPLOG(INFO) << "Could not obtain exception context.";
return EXPLOITABILITY_ERR_PROCESSING;
}
- MinidumpMemoryList *memory_list = dump_->GetMemoryList();
+ MinidumpMemoryList* memory_list = dump_->GetMemoryList();
bool memory_available = true;
if (!memory_list) {
BPLOG(INFO) << "Minidump memory segments not available.";
@@ -195,7 +195,7 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
return EXPLOITABILITY_ERR_PROCESSING;
break;
}
- MinidumpMemoryRegion *instruction_region = 0;
+ MinidumpMemoryRegion* instruction_region = 0;
if (memory_available) {
instruction_region =
memory_list->GetMemoryRegionForAddress(instruction_ptr);
@@ -211,7 +211,7 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
available_memory = available_memory > kDisassembleBytesBeyondPC ?
kDisassembleBytesBeyondPC : available_memory;
if (available_memory) {
- const uint8_t *raw_memory =
+ const uint8_t* raw_memory =
instruction_region->GetMemory() + memory_offset;
DisassemblerX86 disassembler(raw_memory,
available_memory,
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver.cc b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver.cc
index 4a3d000714e..3f8ec5082d2 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver.cc
@@ -61,7 +61,7 @@ bool FastSourceLineResolver::ShouldDeleteMemoryBufferAfterLoadModule() {
return false;
}
-void FastSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
+void FastSourceLineResolver::Module::LookupAddress(StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
// First, look for a FUNC record that covers address. Use
@@ -109,7 +109,7 @@ void FastSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
// WFI: WindowsFrameInfo.
// Returns a WFI object reading from a raw memory chunk of data
-WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) {
+WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char* raw) {
const WindowsFrameInfo::StackInfoTypes type =
static_cast<const WindowsFrameInfo::StackInfoTypes>(
*reinterpret_cast<const int32_t*>(raw));
@@ -117,7 +117,7 @@ WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) {
// The first 8 bytes of int data are unused.
// They correspond to "StackInfoTypes type_;" and "int valid;"
// data member of WFI.
- const uint32_t *para_uint32 = reinterpret_cast<const uint32_t*>(
+ const uint32_t* para_uint32 = reinterpret_cast<const uint32_t*>(
raw + 2 * sizeof(int32_t));
uint32_t prolog_size = para_uint32[0];;
@@ -126,7 +126,7 @@ WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) {
uint32_t saved_register_size = para_uint32[3];
uint32_t local_size = para_uint32[4];
uint32_t max_stack_size = para_uint32[5];
- const char *boolean = reinterpret_cast<const char*>(para_uint32 + 6);
+ const char* boolean = reinterpret_cast<const char*>(para_uint32 + 6);
bool allocates_base_pointer = (*boolean != 0);
string program_string = boolean + 1;
@@ -145,15 +145,15 @@ WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) {
// Does NOT take ownership of mem_buffer.
// In addition, treat mem_buffer as const char*.
bool FastSourceLineResolver::Module::LoadMapFromMemory(
- char *memory_buffer,
+ char* memory_buffer,
size_t memory_buffer_size) {
if (!memory_buffer) return false;
// Read the "is_corrupt" flag.
- const char *mem_buffer = memory_buffer;
+ const char* mem_buffer = memory_buffer;
mem_buffer = SimpleSerializer<bool>::Read(mem_buffer, &is_corrupt_);
- const uint32_t *map_sizes = reinterpret_cast<const uint32_t*>(mem_buffer);
+ const uint32_t* map_sizes = reinterpret_cast<const uint32_t*>(mem_buffer);
unsigned int header_size = kNumberMaps_ * sizeof(unsigned int);
@@ -185,8 +185,8 @@ bool FastSourceLineResolver::Module::LoadMapFromMemory(
return true;
}
-WindowsFrameInfo *FastSourceLineResolver::Module::FindWindowsFrameInfo(
- const StackFrame *frame) const {
+WindowsFrameInfo* FastSourceLineResolver::Module::FindWindowsFrameInfo(
+ const StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
scoped_ptr<WindowsFrameInfo> result(new WindowsFrameInfo());
@@ -238,8 +238,8 @@ WindowsFrameInfo *FastSourceLineResolver::Module::FindWindowsFrameInfo(
return NULL;
}
-CFIFrameInfo *FastSourceLineResolver::Module::FindCFIFrameInfo(
- const StackFrame *frame) const {
+CFIFrameInfo* FastSourceLineResolver::Module::FindCFIFrameInfo(
+ const StackFrame* frame) const {
MemAddr address = frame->instruction - frame->module->base_address();
MemAddr initial_base, initial_size;
const char* initial_rules = NULL;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_types.h b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_types.h
index 2c010470f5b..2b2b582753f 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_types.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_types.h
@@ -54,16 +54,16 @@
namespace google_breakpad {
struct FastSourceLineResolver::Line : public SourceLineResolverBase::Line {
- void CopyFrom(const Line *line_ptr) {
- const char *raw = reinterpret_cast<const char*>(line_ptr);
+ void CopyFrom(const Line* line_ptr) {
+ const char* raw = reinterpret_cast<const char*>(line_ptr);
CopyFrom(raw);
}
// De-serialize the memory data of a Line.
- void CopyFrom(const char *raw) {
+ void CopyFrom(const char* raw) {
address = *(reinterpret_cast<const MemAddr*>(raw));
size = *(reinterpret_cast<const MemAddr*>(raw + sizeof(address)));
- source_file_id = *(reinterpret_cast<const int32_t *>(
+ source_file_id = *(reinterpret_cast<const int32_t*>(
raw + 2 * sizeof(address)));
line = *(reinterpret_cast<const int32_t*>(
raw + 2 * sizeof(address) + sizeof(source_file_id)));
@@ -72,13 +72,13 @@ struct FastSourceLineResolver::Line : public SourceLineResolverBase::Line {
struct FastSourceLineResolver::Function :
public SourceLineResolverBase::Function {
- void CopyFrom(const Function *func_ptr) {
- const char *raw = reinterpret_cast<const char*>(func_ptr);
+ void CopyFrom(const Function* func_ptr) {
+ const char* raw = reinterpret_cast<const char*>(func_ptr);
CopyFrom(raw);
}
// De-serialize the memory data of a Function.
- void CopyFrom(const char *raw) {
+ void CopyFrom(const char* raw) {
size_t name_size = strlen(raw) + 1;
name = raw;
address = *(reinterpret_cast<const MemAddr*>(raw + name_size));
@@ -95,13 +95,13 @@ public SourceLineResolverBase::Function {
struct FastSourceLineResolver::PublicSymbol :
public SourceLineResolverBase::PublicSymbol {
- void CopyFrom(const PublicSymbol *public_symbol_ptr) {
- const char *raw = reinterpret_cast<const char*>(public_symbol_ptr);
+ void CopyFrom(const PublicSymbol* public_symbol_ptr) {
+ const char* raw = reinterpret_cast<const char*>(public_symbol_ptr);
CopyFrom(raw);
}
// De-serialize the memory data of a PublicSymbol.
- void CopyFrom(const char *raw) {
+ void CopyFrom(const char* raw) {
size_t name_size = strlen(raw) + 1;
name = raw;
address = *(reinterpret_cast<const MemAddr*>(raw + name_size));
@@ -112,15 +112,15 @@ public SourceLineResolverBase::PublicSymbol {
class FastSourceLineResolver::Module: public SourceLineResolverBase::Module {
public:
- explicit Module(const string &name) : name_(name), is_corrupt_(false) { }
+ explicit Module(const string& name) : name_(name), is_corrupt_(false) { }
virtual ~Module() { }
// Looks up the given relative address, and fills the StackFrame struct
// with the result.
- virtual void LookupAddress(StackFrame *frame) const;
+ virtual void LookupAddress(StackFrame* frame) const;
// Loads a map from the given buffer in char* type.
- virtual bool LoadMapFromMemory(char *memory_buffer,
+ virtual bool LoadMapFromMemory(char* memory_buffer,
size_t memory_buffer_size);
// Tells whether the loaded symbol data is corrupt. Return value is
@@ -132,13 +132,13 @@ class FastSourceLineResolver::Module: public SourceLineResolverBase::Module {
// is not available, returns NULL. A NULL return value does not indicate
// an error. The caller takes ownership of any returned WindowsFrameInfo
// object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) const;
+ virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame) const;
// If CFI stack walking information is available covering ADDRESS,
// return a CFIFrameInfo structure describing it. If the information
// is not available, return NULL. The caller takes ownership of any
// returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const;
+ virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) const;
// Number of serialized map components of Module.
static const int kNumberMaps_ = 5 + WindowsFrameInfo::STACK_INFO_LAST;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_unittest.cc
index 87b13c522e8..0ec5f91d4e8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/fast_source_line_resolver_unittest.cc
@@ -94,15 +94,15 @@ class TestCodeModule : public CodeModule {
class MockMemoryRegion: public MemoryRegion {
uint64_t GetBase() const { return 0x10000; }
uint32_t GetSize() const { return 0x01000; }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
*value = address & 0xff;
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
*value = address & 0xffff;
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
switch (address) {
case 0x10008: *value = 0x98ecadc3; break; // saved %ebx
case 0x1000c: *value = 0x878f7524; break; // saved %esi
@@ -113,7 +113,7 @@ class MockMemoryRegion: public MemoryRegion {
}
return true;
}
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
*value = address;
return true;
}
@@ -127,9 +127,9 @@ class MockMemoryRegion: public MemoryRegion {
// EXPECTED's.) Also verify that ACTUAL has associations for ".ra" and
// ".cfa".
static bool VerifyRegisters(
- const char *file, int line,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &expected,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &actual) {
+ const char* file, int line,
+ const CFIFrameInfo::RegisterValueMap<uint32_t>& expected,
+ const CFIFrameInfo::RegisterValueMap<uint32_t>& actual) {
CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator a;
a = actual.find(".cfa");
if (a == actual.end())
@@ -158,7 +158,7 @@ static bool VerifyRegisters(
return true;
}
-static bool VerifyEmpty(const StackFrame &frame) {
+static bool VerifyEmpty(const StackFrame& frame) {
if (frame.function_name.empty() &&
frame.source_file_name.empty() &&
frame.source_line == 0)
@@ -166,7 +166,7 @@ static bool VerifyEmpty(const StackFrame &frame) {
return false;
}
-static void ClearSourceLineInfo(StackFrame *frame) {
+static void ClearSourceLineInfo(StackFrame* frame) {
frame->function_name.clear();
frame->module = NULL;
frame->source_file_name.clear();
@@ -467,7 +467,7 @@ TEST_F(TestFastSourceLineResolver, TestUnload) {
}
TEST_F(TestFastSourceLineResolver, CompareModule) {
- char *symbol_data;
+ char* symbol_data;
size_t symbol_data_size;
string symbol_data_string;
string filename;
@@ -486,7 +486,7 @@ TEST_F(TestFastSourceLineResolver, CompareModule) {
} // namespace
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/logging.cc b/chromium/third_party/breakpad/breakpad/src/processor/logging.cc
index d59175a7355..3c5b16165b8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/logging.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/logging.cc
@@ -47,8 +47,8 @@
namespace google_breakpad {
-LogStream::LogStream(std::ostream &stream, Severity severity,
- const char *file, int line)
+LogStream::LogStream(std::ostream& stream, Severity severity,
+ const char* file, int line)
: stream_(stream) {
time_t clock;
time(&clock);
@@ -61,7 +61,7 @@ LogStream::LogStream(std::ostream &stream, Severity severity,
char time_string[20];
strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct);
- const char *severity_string = "UNKNOWN_SEVERITY";
+ const char* severity_string = "UNKNOWN_SEVERITY";
switch (severity) {
case SEVERITY_INFO:
severity_string = "INFO";
@@ -100,7 +100,7 @@ string HexString(int number) {
return string(buffer);
}
-int ErrnoString(string *error_string) {
+int ErrnoString(string* error_string) {
assert(error_string);
// strerror isn't necessarily thread-safe. strerror_r would be preferrable,
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/logging.h b/chromium/third_party/breakpad/breakpad/src/processor/logging.h
index 43f3cfc9516..e6c6eee2af7 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/logging.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/logging.h
@@ -89,22 +89,22 @@ class LogStream {
// Begin logging a message to the stream identified by |stream|, at the
// indicated severity. The file and line parameters should be set so as to
// identify the line of source code that is producing a message.
- LogStream(std::ostream &stream, Severity severity,
- const char *file, int line);
+ LogStream(std::ostream& stream, Severity severity,
+ const char* file, int line);
// Finish logging by printing a newline and flushing the output stream.
~LogStream();
- template<typename T> std::ostream& operator<<(const T &t) {
+ template<typename T> std::ostream& operator<<(const T& t) {
return stream_ << t;
}
private:
- std::ostream &stream_;
+ std::ostream& stream_;
// Disallow copy constructor and assignment operator
- explicit LogStream(const LogStream &that);
- void operator=(const LogStream &that);
+ explicit LogStream(const LogStream& that);
+ void operator=(const LogStream& that);
};
// This class is used to explicitly ignore values in the conditional logging
@@ -116,7 +116,7 @@ class LogMessageVoidify {
// This has to be an operator with a precedence lower than << but higher
// than ?:
- void operator&(std::ostream &) {}
+ void operator&(std::ostream&) {}
};
// Returns number formatted as a hexadecimal string, such as "0x7b".
@@ -127,7 +127,7 @@ string HexString(int number);
// Returns the error code as set in the global errno variable, and sets
// error_string, a required argument, to a string describing that error
// code.
-int ErrnoString(string *error_string);
+int ErrnoString(string* error_string);
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers-inl.h
index 61c7bbd7c83..4933f907be8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers-inl.h
@@ -53,7 +53,7 @@ namespace google_breakpad {
template<typename Key, typename Value>
size_t StdMapSerializer<Key, Value>::SizeOf(
- const std::map<Key, Value> &m) const {
+ const std::map<Key, Value>& m) const {
size_t size = 0;
size_t header_size = (1 + m.size()) * sizeof(uint32_t);
size += header_size;
@@ -67,22 +67,22 @@ size_t StdMapSerializer<Key, Value>::SizeOf(
}
template<typename Key, typename Value>
-char *StdMapSerializer<Key, Value>::Write(const std::map<Key, Value> &m,
- char *dest) const {
+char* StdMapSerializer<Key, Value>::Write(const std::map<Key, Value>& m,
+ char* dest) const {
if (!dest) {
BPLOG(ERROR) << "StdMapSerializer failed: write to NULL address.";
return NULL;
}
- char *start_address = dest;
+ char* start_address = dest;
// Write header:
// Number of nodes.
dest = SimpleSerializer<uint32_t>::Write(m.size(), dest);
// Nodes offsets.
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
+ uint32_t* offsets = reinterpret_cast<uint32_t*>(dest);
dest += sizeof(uint32_t) * m.size();
- char *key_address = dest;
+ char* key_address = dest;
dest += sizeof(Key) * m.size();
// Traverse map.
@@ -97,12 +97,12 @@ char *StdMapSerializer<Key, Value>::Write(const std::map<Key, Value> &m,
}
template<typename Key, typename Value>
-char *StdMapSerializer<Key, Value>::Serialize(
- const std::map<Key, Value> &m, unsigned int *size) const {
+char* StdMapSerializer<Key, Value>::Serialize(
+ const std::map<Key, Value>& m, unsigned int* size) const {
// Compute size of memory to be allocated.
unsigned int size_to_alloc = SizeOf(m);
// Allocate memory.
- char *serialized_data = new char[size_to_alloc];
+ char* serialized_data = new char[size_to_alloc];
if (!serialized_data) {
BPLOG(INFO) << "StdMapSerializer memory allocation failed.";
if (size) *size = 0;
@@ -117,7 +117,7 @@ char *StdMapSerializer<Key, Value>::Serialize(
template<typename Address, typename Entry>
size_t RangeMapSerializer<Address, Entry>::SizeOf(
- const RangeMap<Address, Entry> &m) const {
+ const RangeMap<Address, Entry>& m) const {
size_t size = 0;
size_t header_size = (1 + m.map_.size()) * sizeof(uint32_t);
size += header_size;
@@ -135,22 +135,22 @@ size_t RangeMapSerializer<Address, Entry>::SizeOf(
}
template<typename Address, typename Entry>
-char *RangeMapSerializer<Address, Entry>::Write(
- const RangeMap<Address, Entry> &m, char *dest) const {
+char* RangeMapSerializer<Address, Entry>::Write(
+ const RangeMap<Address, Entry>& m, char* dest) const {
if (!dest) {
BPLOG(ERROR) << "RangeMapSerializer failed: write to NULL address.";
return NULL;
}
- char *start_address = dest;
+ char* start_address = dest;
// Write header:
// Number of nodes.
dest = SimpleSerializer<uint32_t>::Write(m.map_.size(), dest);
// Nodes offsets.
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
+ uint32_t* offsets = reinterpret_cast<uint32_t*>(dest);
dest += sizeof(uint32_t) * m.map_.size();
- char *key_address = dest;
+ char* key_address = dest;
dest += sizeof(Address) * m.map_.size();
// Traverse map.
@@ -166,12 +166,12 @@ char *RangeMapSerializer<Address, Entry>::Write(
}
template<typename Address, typename Entry>
-char *RangeMapSerializer<Address, Entry>::Serialize(
- const RangeMap<Address, Entry> &m, unsigned int *size) const {
+char* RangeMapSerializer<Address, Entry>::Serialize(
+ const RangeMap<Address, Entry>& m, unsigned int* size) const {
// Compute size of memory to be allocated.
unsigned int size_to_alloc = SizeOf(m);
// Allocate memory.
- char *serialized_data = new char[size_to_alloc];
+ char* serialized_data = new char[size_to_alloc];
if (!serialized_data) {
BPLOG(INFO) << "RangeMapSerializer memory allocation failed.";
if (size) *size = 0;
@@ -188,7 +188,7 @@ char *RangeMapSerializer<Address, Entry>::Serialize(
template<class AddrType, class EntryType>
size_t ContainedRangeMapSerializer<AddrType, EntryType>::SizeOf(
- const ContainedRangeMap<AddrType, EntryType> *m) const {
+ const ContainedRangeMap<AddrType, EntryType>* m) const {
size_t size = 0;
size_t header_size = addr_serializer_.SizeOf(m->base_)
+ entry_serializer_.SizeOf(m->entry_)
@@ -209,8 +209,8 @@ size_t ContainedRangeMapSerializer<AddrType, EntryType>::SizeOf(
}
template<class AddrType, class EntryType>
-char *ContainedRangeMapSerializer<AddrType, EntryType>::Write(
- const ContainedRangeMap<AddrType, EntryType> *m, char *dest) const {
+char* ContainedRangeMapSerializer<AddrType, EntryType>::Write(
+ const ContainedRangeMap<AddrType, EntryType>* m, char* dest) const {
if (!dest) {
BPLOG(ERROR) << "StdMapSerializer failed: write to NULL address.";
return NULL;
@@ -221,15 +221,15 @@ char *ContainedRangeMapSerializer<AddrType, EntryType>::Write(
dest = entry_serializer_.Write(m->entry_, dest);
// Write map<<AddrType, ContainedRangeMap*>:
- char *map_address = dest;
+ char* map_address = dest;
if (m->map_ == NULL) {
dest = SimpleSerializer<uint32_t>::Write(0, dest);
} else {
dest = SimpleSerializer<uint32_t>::Write(m->map_->size(), dest);
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
+ uint32_t* offsets = reinterpret_cast<uint32_t*>(dest);
dest += sizeof(uint32_t) * m->map_->size();
- char *key_address = dest;
+ char* key_address = dest;
dest += sizeof(AddrType) * m->map_->size();
// Traverse map.
@@ -246,11 +246,11 @@ char *ContainedRangeMapSerializer<AddrType, EntryType>::Write(
}
template<class AddrType, class EntryType>
-char *ContainedRangeMapSerializer<AddrType, EntryType>::Serialize(
- const ContainedRangeMap<AddrType, EntryType> *m, unsigned int *size) const {
+char* ContainedRangeMapSerializer<AddrType, EntryType>::Serialize(
+ const ContainedRangeMap<AddrType, EntryType>* m, unsigned int* size) const {
unsigned int size_to_alloc = SizeOf(m);
// Allocating memory.
- char *serialized_data = new char[size_to_alloc];
+ char* serialized_data = new char[size_to_alloc];
if (!serialized_data) {
BPLOG(INFO) << "ContainedRangeMapSerializer memory allocation failed.";
if (size) *size = 0;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers.h b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers.h
index a0b9d3fd67a..3d504158e50 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers.h
@@ -53,20 +53,20 @@ template<typename Key, typename Value>
class StdMapSerializer {
public:
// Calculate the memory size of serialized data.
- size_t SizeOf(const std::map<Key, Value> &m) const;
+ size_t SizeOf(const std::map<Key, Value>& m) const;
// Writes the serialized data to memory with start address = dest,
// and returns the "end" of data, i.e., return the address follow the final
// byte of data.
// NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const std::map<Key, Value> &m, char* dest) const;
+ char* Write(const std::map<Key, Value>& m, char* dest) const;
// Serializes a std::map object into a chunk of memory data with format
// described in "StaticMap.h" comment.
// Returns a pointer to the serialized data. If size != NULL, *size is set
// to the size of serialized data, i.e., SizeOf(m).
// Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const std::map<Key, Value> &m, unsigned int *size) const;
+ char* Serialize(const std::map<Key, Value>& m, unsigned int* size) const;
private:
SimpleSerializer<Key> key_serializer_;
@@ -79,14 +79,14 @@ template<typename Addr, typename Entry>
class AddressMapSerializer {
public:
// Calculate the memory size of serialized data.
- size_t SizeOf(const AddressMap<Addr, Entry> &m) const {
+ size_t SizeOf(const AddressMap<Addr, Entry>& m) const {
return std_map_serializer_.SizeOf(m.map_);
}
// Write the serialized data to specified memory location. Return the "end"
// of data, i.e., return the address after the final byte of data.
// NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const AddressMap<Addr, Entry> &m, char *dest) const {
+ char* Write(const AddressMap<Addr, Entry>& m, char* dest) const {
return std_map_serializer_.Write(m.map_, dest);
}
@@ -94,7 +94,7 @@ class AddressMapSerializer {
// Returns a pointer to the serialized data. If size != NULL, *size is set
// to the size of serialized data, i.e., SizeOf(m).
// Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const AddressMap<Addr, Entry> &m, unsigned int *size) const {
+ char* Serialize(const AddressMap<Addr, Entry>& m, unsigned int* size) const {
return std_map_serializer_.Serialize(m.map_, size);
}
@@ -110,18 +110,18 @@ template<typename Address, typename Entry>
class RangeMapSerializer {
public:
// Calculate the memory size of serialized data.
- size_t SizeOf(const RangeMap<Address, Entry> &m) const;
+ size_t SizeOf(const RangeMap<Address, Entry>& m) const;
// Write the serialized data to specified memory location. Return the "end"
// of data, i.e., return the address after the final byte of data.
// NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const RangeMap<Address, Entry> &m, char* dest) const;
+ char* Write(const RangeMap<Address, Entry>& m, char* dest) const;
// Serializes a RangeMap object into a chunk of memory data.
// Returns a pointer to the serialized data. If size != NULL, *size is set
// to the size of serialized data, i.e., SizeOf(m).
// Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const RangeMap<Address, Entry> &m, unsigned int *size) const;
+ char* Serialize(const RangeMap<Address, Entry>& m, unsigned int* size) const;
private:
// Convenient type name for Range.
@@ -139,20 +139,20 @@ template<class AddrType, class EntryType>
class ContainedRangeMapSerializer {
public:
// Calculate the memory size of serialized data.
- size_t SizeOf(const ContainedRangeMap<AddrType, EntryType> *m) const;
+ size_t SizeOf(const ContainedRangeMap<AddrType, EntryType>* m) const;
// Write the serialized data to specified memory location. Return the "end"
// of data, i.e., return the address after the final byte of data.
// NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const ContainedRangeMap<AddrType, EntryType> *m,
+ char* Write(const ContainedRangeMap<AddrType, EntryType>* m,
char* dest) const;
// Serializes a ContainedRangeMap object into a chunk of memory data.
// Returns a pointer to the serialized data. If size != NULL, *size is set
// to the size of serialized data, i.e., SizeOf(m).
// Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const ContainedRangeMap<AddrType, EntryType> *m,
- unsigned int *size) const;
+ char* Serialize(const ContainedRangeMap<AddrType, EntryType>* m,
+ unsigned int* size) const;
private:
// Convenient type name for the underlying map type.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers_unittest.cc
index 0d872ec2e21..48b9c4b246a 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/map_serializers_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/map_serializers_unittest.cc
@@ -63,7 +63,7 @@ class TestStdMapSerializer : public ::testing::Test {
std::map<AddrType, EntryType> std_map_;
google_breakpad::StdMapSerializer<AddrType, EntryType> serializer_;
uint32_t serialized_size_;
- char *serialized_data_;
+ char* serialized_data_;
};
TEST_F(TestStdMapSerializer, EmptyMapTestCase) {
@@ -135,7 +135,7 @@ class TestAddressMapSerializer : public ::testing::Test {
google_breakpad::AddressMap<AddrType, EntryType> address_map_;
google_breakpad::AddressMapSerializer<AddrType, EntryType> serializer_;
uint32_t serialized_size_;
- char *serialized_data_;
+ char* serialized_data_;
};
TEST_F(TestAddressMapSerializer, EmptyMapTestCase) {
@@ -210,7 +210,7 @@ class TestRangeMapSerializer : public ::testing::Test {
google_breakpad::RangeMap<AddrType, EntryType> range_map_;
google_breakpad::RangeMapSerializer<AddrType, EntryType> serializer_;
uint32_t serialized_size_;
- char *serialized_data_;
+ char* serialized_data_;
};
TEST_F(TestRangeMapSerializer, EmptyMapTestCase) {
@@ -283,7 +283,7 @@ class TestContainedRangeMapSerializer : public ::testing::Test {
google_breakpad::ContainedRangeMap<AddrType, EntryType> crm_map_;
google_breakpad::ContainedRangeMapSerializer<AddrType, EntryType> serializer_;
uint32_t serialized_size_;
- char *serialized_data_;
+ char* serialized_data_;
};
TEST_F(TestContainedRangeMapSerializer, EmptyMapTestCase) {
@@ -379,7 +379,7 @@ TEST_F(TestContainedRangeMapSerializer, MapWithTwoLevelsTestCase) {
}
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/microdump_stackwalk.cc b/chromium/third_party/breakpad/breakpad/src/processor/microdump_stackwalk.cc
index 220396ed933..03fa77e1a8e 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/microdump_stackwalk.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/microdump_stackwalk.cc
@@ -140,7 +140,7 @@ static void SetupOptions(int argc, const char *argv[], Options* options) {
options->machine_readable = false;
options->output_stack_contents = false;
- while ((ch = getopt(argc, (char * const *)argv, "hms")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "hms")) != -1) {
switch (ch) {
case 'h':
Usage(argc, argv, false);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump.cc
index f0075eb22df..1f479558945 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump.cc
@@ -1611,7 +1611,7 @@ MinidumpContext* MinidumpThread::GetContext() {
}
-bool MinidumpThread::GetThreadID(uint32_t *thread_id) const {
+bool MinidumpThread::GetThreadID(uint32_t* thread_id) const {
BPLOG_IF(ERROR, !thread_id) << "MinidumpThread::GetThreadID requires "
"|thread_id|";
assert(thread_id);
@@ -1973,14 +1973,14 @@ string MinidumpModule::code_identifier() const {
if (!has_debug_info_)
return "";
- MinidumpSystemInfo *minidump_system_info = minidump_->GetSystemInfo();
+ MinidumpSystemInfo* minidump_system_info = minidump_->GetSystemInfo();
if (!minidump_system_info) {
BPLOG(ERROR) << "MinidumpModule code_identifier requires "
"MinidumpSystemInfo";
return "";
}
- const MDRawSystemInfo *raw_system_info = minidump_system_info->system_info();
+ const MDRawSystemInfo* raw_system_info = minidump_system_info->system_info();
if (!raw_system_info) {
BPLOG(ERROR) << "MinidumpModule code_identifier requires MDRawSystemInfo";
return "";
@@ -2093,7 +2093,7 @@ string MinidumpModule::debug_file() const {
// No usable CodeView record. Try the miscellaneous debug record.
if (misc_record_) {
const MDImageDebugMisc* misc_record =
- reinterpret_cast<const MDImageDebugMisc *>(&(*misc_record_)[0]);
+ reinterpret_cast<const MDImageDebugMisc*>(&(*misc_record_)[0]);
if (!misc_record->unicode) {
// If it's not Unicode, just stuff it into the string. It's unclear
// if misc_record->data is 0-terminated, so use an explicit size.
@@ -2549,7 +2549,7 @@ void MinidumpModule::Print() {
code_identifier().c_str());
uint32_t cv_record_size;
- const uint8_t *cv_record = GetCVRecord(&cv_record_size);
+ const uint8_t* cv_record = GetCVRecord(&cv_record_size);
if (cv_record) {
if (cv_record_signature_ == MD_CVINFOPDB70_SIGNATURE) {
const MDCVInfoPDB70* cv_record_70 =
@@ -3215,7 +3215,7 @@ bool MinidumpException::Read(uint32_t expected_size) {
}
-bool MinidumpException::GetThreadID(uint32_t *thread_id) const {
+bool MinidumpException::GetThreadID(uint32_t* thread_id) const {
BPLOG_IF(ERROR, !thread_id) << "MinidumpException::GetThreadID requires "
"|thread_id|";
assert(thread_id);
@@ -3699,14 +3699,14 @@ string MinidumpUnloadedModule::code_identifier() const {
return "";
}
- MinidumpSystemInfo *minidump_system_info = minidump_->GetSystemInfo();
+ 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();
+ const MDRawSystemInfo* raw_system_info = minidump_system_info->system_info();
if (!raw_system_info) {
BPLOG(ERROR) << "MinidumpUnloadedModule code_identifier requires "
<< "MDRawSystemInfo";
@@ -4356,7 +4356,7 @@ bool MinidumpBreakpadInfo::Read(uint32_t expected_size) {
}
-bool MinidumpBreakpadInfo::GetDumpThreadID(uint32_t *thread_id) const {
+bool MinidumpBreakpadInfo::GetDumpThreadID(uint32_t* thread_id) const {
BPLOG_IF(ERROR, !thread_id) << "MinidumpBreakpadInfo::GetDumpThreadID "
"requires |thread_id|";
assert(thread_id);
@@ -4377,7 +4377,7 @@ bool MinidumpBreakpadInfo::GetDumpThreadID(uint32_t *thread_id) const {
}
-bool MinidumpBreakpadInfo::GetRequestingThreadID(uint32_t *thread_id)
+bool MinidumpBreakpadInfo::GetRequestingThreadID(uint32_t* thread_id)
const {
BPLOG_IF(ERROR, !thread_id) << "MinidumpBreakpadInfo::GetRequestingThreadID "
"requires |thread_id|";
@@ -4695,7 +4695,7 @@ void MinidumpMemoryInfoList::Print() {
// MinidumpLinuxMaps
//
-MinidumpLinuxMaps::MinidumpLinuxMaps(Minidump *minidump)
+MinidumpLinuxMaps::MinidumpLinuxMaps(Minidump* minidump)
: MinidumpObject(minidump) {
}
@@ -4711,7 +4711,7 @@ void MinidumpLinuxMaps::Print() const {
// MinidumpLinuxMapsList
//
-MinidumpLinuxMapsList::MinidumpLinuxMapsList(Minidump *minidump)
+MinidumpLinuxMapsList::MinidumpLinuxMapsList(Minidump* minidump)
: MinidumpStream(minidump),
maps_(NULL),
maps_count_(0) {
@@ -4726,7 +4726,7 @@ MinidumpLinuxMapsList::~MinidumpLinuxMapsList() {
}
}
-const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsForAddress(
+const MinidumpLinuxMaps* MinidumpLinuxMapsList::GetLinuxMapsForAddress(
uint64_t address) const {
if (!valid_ || (maps_ == NULL)) {
BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsForAddress";
@@ -4748,7 +4748,7 @@ const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsForAddress(
return NULL;
}
-const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsAtIndex(
+const MinidumpLinuxMaps* MinidumpLinuxMapsList::GetLinuxMapsAtIndex(
unsigned int index) const {
if (!valid_ || (maps_ == NULL)) {
BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsAtIndex";
@@ -5090,7 +5090,7 @@ bool Minidump::Open() {
return true;
}
-bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t *context_cpu_flags) {
+bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t* context_cpu_flags) {
// Initialize output parameters
*context_cpu_flags = 0;
@@ -5366,8 +5366,8 @@ MinidumpMemoryInfoList* Minidump::GetMemoryInfoList() {
return GetStream(&memory_info_list);
}
-MinidumpLinuxMapsList *Minidump::GetLinuxMapsList() {
- MinidumpLinuxMapsList *linux_maps_list;
+MinidumpLinuxMapsList* Minidump::GetLinuxMapsList() {
+ MinidumpLinuxMapsList* linux_maps_list;
return GetStream(&linux_maps_list);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump_dump.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump_dump.cc
index 4716aa08ef8..06802f24fc5 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump_dump.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump_dump.cc
@@ -91,7 +91,7 @@ static void DumpRawStream(Minidump *minidump,
// in compatibility warnings.
uint32_t int_remaining = remaining;
printf("%.*s", int_remaining, &contents[current_offset]);
- char *next_null = reinterpret_cast<char *>(
+ char *next_null = reinterpret_cast<char*>(
memchr(&contents[current_offset], 0, remaining));
if (next_null == NULL)
break;
@@ -241,7 +241,7 @@ static void
SetupOptions(int argc, char *argv[], Options *options) {
int ch;
- while ((ch = getopt(argc, (char * const *)argv, "xh")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "xh")) != -1) {
switch (ch) {
case 'x':
options->hexdump = true;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor.cc
index a90e6188762..04b7e129e51 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor.cc
@@ -48,16 +48,16 @@
namespace google_breakpad {
-MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
- SourceLineResolverInterface *resolver)
+MinidumpProcessor::MinidumpProcessor(SymbolSupplier* supplier,
+ SourceLineResolverInterface* resolver)
: frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
own_frame_symbolizer_(true),
enable_exploitability_(false),
enable_objdump_(false) {
}
-MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
- SourceLineResolverInterface *resolver,
+MinidumpProcessor::MinidumpProcessor(SymbolSupplier* supplier,
+ SourceLineResolverInterface* resolver,
bool enable_exploitability)
: frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
own_frame_symbolizer_(true),
@@ -65,7 +65,7 @@ MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
enable_objdump_(false) {
}
-MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer,
+MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer* frame_symbolizer,
bool enable_exploitability)
: frame_symbolizer_(frame_symbolizer),
own_frame_symbolizer_(false),
@@ -79,13 +79,13 @@ MinidumpProcessor::~MinidumpProcessor() {
}
ProcessResult MinidumpProcessor::Process(
- Minidump *dump, ProcessState *process_state) {
+ Minidump* dump, ProcessState* process_state) {
assert(dump);
assert(process_state);
process_state->Clear();
- const MDRawHeader *header = dump->header();
+ const MDRawHeader* header = dump->header();
if (!header) {
BPLOG(ERROR) << "Minidump " << dump->path() << " has no header";
return PROCESS_ERROR_NO_MINIDUMP_HEADER;
@@ -103,14 +103,14 @@ ProcessResult MinidumpProcessor::Process(
uint32_t requesting_thread_id = 0;
bool has_requesting_thread = false;
- MinidumpBreakpadInfo *breakpad_info = dump->GetBreakpadInfo();
+ MinidumpBreakpadInfo* breakpad_info = dump->GetBreakpadInfo();
if (breakpad_info) {
has_dump_thread = breakpad_info->GetDumpThreadID(&dump_thread_id);
has_requesting_thread =
breakpad_info->GetRequestingThreadID(&requesting_thread_id);
}
- MinidumpException *exception = dump->GetException();
+ MinidumpException* exception = dump->GetException();
if (exception) {
process_state->crashed_ = true;
has_requesting_thread = exception->GetThreadID(&requesting_thread_id);
@@ -143,7 +143,7 @@ ProcessResult MinidumpProcessor::Process(
// This will just return an empty string if it doesn't exist.
process_state->assertion_ = GetAssertion(dump);
- MinidumpModuleList *module_list = dump->GetModuleList();
+ MinidumpModuleList* module_list = dump->GetModuleList();
// Put a copy of the module list into ProcessState object. This is not
// necessarily a MinidumpModuleList, but it adheres to the CodeModules
@@ -163,19 +163,19 @@ ProcessResult MinidumpProcessor::Process(
}
}
- MinidumpUnloadedModuleList *unloaded_module_list =
+ MinidumpUnloadedModuleList* unloaded_module_list =
dump->GetUnloadedModuleList();
if (unloaded_module_list) {
process_state->unloaded_modules_ = unloaded_module_list->Copy();
}
- MinidumpMemoryList *memory_list = dump->GetMemoryList();
+ MinidumpMemoryList* memory_list = dump->GetMemoryList();
if (memory_list) {
BPLOG(INFO) << "Found " << memory_list->region_count()
<< " memory regions.";
}
- MinidumpThreadList *threads = dump->GetThreadList();
+ MinidumpThreadList* threads = dump->GetThreadList();
if (!threads) {
BPLOG(ERROR) << "Minidump " << dump->path() << " has no thread list";
return PROCESS_ERROR_NO_THREAD_LIST;
@@ -207,7 +207,7 @@ ProcessResult MinidumpProcessor::Process(
thread_index, thread_count);
string thread_string = dump->path() + ":" + thread_string_buffer;
- MinidumpThread *thread = threads->GetThreadAtIndex(thread_index);
+ MinidumpThread* thread = threads->GetThreadAtIndex(thread_index);
if (!thread) {
BPLOG(ERROR) << "Could not get thread for " << thread_string;
return PROCESS_ERROR_GETTING_THREAD;
@@ -230,7 +230,7 @@ ProcessResult MinidumpProcessor::Process(
continue;
}
- MinidumpContext *context = thread->GetContext();
+ MinidumpContext* context = thread->GetContext();
if (has_requesting_thread && thread_id == requesting_thread_id) {
if (found_requesting_thread) {
@@ -257,7 +257,7 @@ ProcessResult MinidumpProcessor::Process(
// would not result in the expected stack trace from the time of the
// crash. If the exception context is invalid, however, we fall back
// on the thread context.
- MinidumpContext *ctx = exception->GetContext();
+ MinidumpContext* ctx = exception->GetContext();
context = ctx ? ctx : thread->GetContext();
}
}
@@ -265,7 +265,7 @@ ProcessResult MinidumpProcessor::Process(
// If the memory region for the stack cannot be read using the RVA stored
// in the memory descriptor inside MINIDUMP_THREAD, try to locate and use
// a memory region (containing the stack) from the minidump memory list.
- MinidumpMemoryRegion *thread_memory = thread->GetMemory();
+ MinidumpMemoryRegion* thread_memory = thread->GetMemory();
if (!thread_memory && memory_list) {
uint64_t start_stack_memory_range = thread->GetStartOfStackMemoryRange();
if (start_stack_memory_range) {
@@ -350,7 +350,7 @@ ProcessResult MinidumpProcessor::Process(
}
ProcessResult MinidumpProcessor::Process(
- const string &minidump_file, ProcessState *process_state) {
+ const string& minidump_file, ProcessState* process_state) {
BPLOG(INFO) << "Processing minidump in file " << minidump_file;
Minidump dump(minidump_file);
@@ -365,9 +365,9 @@ ProcessResult MinidumpProcessor::Process(
// Returns the MDRawSystemInfo from a minidump, or NULL if system info is
// not available from the minidump. If system_info is non-NULL, it is used
// to pass back the MinidumpSystemInfo object.
-static const MDRawSystemInfo* GetSystemInfo(Minidump *dump,
- MinidumpSystemInfo **system_info) {
- MinidumpSystemInfo *minidump_system_info = dump->GetSystemInfo();
+static const MDRawSystemInfo* GetSystemInfo(Minidump* dump,
+ MinidumpSystemInfo** system_info) {
+ MinidumpSystemInfo* minidump_system_info = dump->GetSystemInfo();
if (!minidump_system_info)
return NULL;
@@ -520,15 +520,15 @@ static void GetARMCpuInfo(const MDRawSystemInfo* raw_info,
}
// static
-bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
+bool MinidumpProcessor::GetCPUInfo(Minidump* dump, SystemInfo* info) {
assert(dump);
assert(info);
info->cpu.clear();
info->cpu_info.clear();
- MinidumpSystemInfo *system_info;
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
+ MinidumpSystemInfo* system_info;
+ const MDRawSystemInfo* raw_system_info = GetSystemInfo(dump, &system_info);
if (!raw_system_info)
return false;
@@ -541,7 +541,7 @@ bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
else
info->cpu = "amd64";
- const string *cpu_vendor = system_info->GetCPUVendor();
+ const string* cpu_vendor = system_info->GetCPUVendor();
if (cpu_vendor) {
info->cpu_info = *cpu_vendor;
info->cpu_info.append(" ");
@@ -608,7 +608,7 @@ bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
}
// static
-bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
+bool MinidumpProcessor::GetOSInfo(Minidump* dump, SystemInfo* info) {
assert(dump);
assert(info);
@@ -616,8 +616,8 @@ bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
info->os_short.clear();
info->os_version.clear();
- MinidumpSystemInfo *system_info;
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
+ MinidumpSystemInfo* system_info;
+ const MDRawSystemInfo* raw_system_info = GetSystemInfo(dump, &system_info);
if (!raw_system_info)
return false;
@@ -691,7 +691,7 @@ bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
raw_system_info->build_number);
info->os_version = os_version_string;
- const string *csd_version = system_info->GetCSDVersion();
+ const string* csd_version = system_info->GetCSDVersion();
if (csd_version) {
info->os_version.append(" ");
info->os_version.append(*csd_version);
@@ -727,12 +727,12 @@ bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump,
}
// static
-string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
- MinidumpException *exception = dump->GetException();
+string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address) {
+ MinidumpException* exception = dump->GetException();
if (!exception)
return "";
- const MDRawExceptionStream *raw_exception = exception->exception();
+ const MDRawExceptionStream* raw_exception = exception->exception();
if (!raw_exception)
return "";
@@ -752,7 +752,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
flags_string);
string reason = reason_string;
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, NULL);
+ const MDRawSystemInfo* raw_system_info = GetSystemInfo(dump, NULL);
if (!raw_system_info)
return reason;
@@ -1743,12 +1743,12 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
}
// static
-string MinidumpProcessor::GetAssertion(Minidump *dump) {
- MinidumpAssertion *assertion = dump->GetAssertion();
+string MinidumpProcessor::GetAssertion(Minidump* dump) {
+ MinidumpAssertion* assertion = dump->GetAssertion();
if (!assertion)
return "";
- const MDRawAssertionInfo *raw_assertion = assertion->assertion();
+ const MDRawAssertionInfo* raw_assertion = assertion->assertion();
if (!raw_assertion)
return "";
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor_unittest.cc
index a4ac3685ace..306c2f0b072 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump_processor_unittest.cc
@@ -127,16 +127,16 @@ class MockMinidumpMemoryRegion : public MinidumpMemoryRegion {
uint64_t GetBase() const { return region_.GetBase(); }
uint32_t GetSize() const { return region_.GetSize(); }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
return region_.GetMemoryAtAddress(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
return region_.GetMemoryAtAddress(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
return region_.GetMemoryAtAddress(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
return region_.GetMemoryAtAddress(address, value);
}
@@ -188,11 +188,11 @@ using ::testing::Property;
using ::testing::Return;
using ::testing::SetArgumentPointee;
-static const char *kSystemInfoOS = "Windows NT";
-static const char *kSystemInfoOSShort = "windows";
-static const char *kSystemInfoOSVersion = "5.1.2600 Service Pack 2";
-static const char *kSystemInfoCPU = "x86";
-static const char *kSystemInfoCPUInfo =
+static const char* kSystemInfoOS = "Windows NT";
+static const char* kSystemInfoOSShort = "windows";
+static const char* kSystemInfoOSVersion = "5.1.2600 Service Pack 2";
+static const char* kSystemInfoCPU = "x86";
+static const char* kSystemInfoCPUInfo =
"GenuineIntel family 6 model 13 stepping 8";
#define ASSERT_TRUE_ABORT(cond) \
@@ -204,7 +204,7 @@ static const char *kSystemInfoCPUInfo =
#define ASSERT_EQ_ABORT(e1, e2) ASSERT_TRUE_ABORT((e1) == (e2))
static string GetTestDataPath() {
- char *srcdir = getenv("srcdir");
+ char* srcdir = getenv("srcdir");
return string(srcdir ? srcdir : ".") + "/src/processor/testdata/";
}
@@ -213,35 +213,35 @@ class TestSymbolSupplier : public SymbolSupplier {
public:
TestSymbolSupplier() : interrupt_(false) {}
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file);
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data);
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
+ virtual SymbolResult GetCStringSymbolData(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size);
- virtual void FreeSymbolData(const CodeModule *module);
+ virtual void FreeSymbolData(const CodeModule* module);
// When set to true, causes the SymbolSupplier to return INTERRUPT
void set_interrupt(bool interrupt) { interrupt_ = interrupt; }
private:
bool interrupt_;
- map<string, char *> memory_buffers_;
+ map<string, char*> memory_buffers_;
};
SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) {
+ const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file) {
ASSERT_TRUE_ABORT(module);
ASSERT_TRUE_ABORT(system_info);
ASSERT_EQ_ABORT(system_info->cpu, kSystemInfoCPU);
@@ -264,10 +264,10 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
}
SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
+ const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data) {
SymbolSupplier::SymbolResult s = GetSymbolFile(module, system_info,
symbol_file);
if (s == FOUND) {
@@ -281,11 +281,11 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
}
SymbolSupplier::SymbolResult TestSymbolSupplier::GetCStringSymbolData(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
+ const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size) {
string symbol_data_string;
SymbolSupplier::SymbolResult s = GetSymbolFile(module,
system_info,
@@ -307,8 +307,8 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetCStringSymbolData(
return s;
}
-void TestSymbolSupplier::FreeSymbolData(const CodeModule *module) {
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
+void TestSymbolSupplier::FreeSymbolData(const CodeModule* module) {
+ map<string, char*>::iterator it = memory_buffers_.find(module->code_file());
if (it != memory_buffers_.end()) {
delete [] it->second;
memory_buffers_.erase(it);
@@ -523,7 +523,7 @@ TEST_F(MinidumpProcessorTest, TestBasicProcessing) {
EXPECT_EQ(1171480435U, state.time_date_stamp());
EXPECT_EQ(1171480435U, state.process_create_time());
- CallStack *stack = state.threads()->at(0);
+ CallStack* stack = state.threads()->at(0);
ASSERT_TRUE(stack);
ASSERT_EQ(stack->frames()->size(), 4U);
@@ -763,7 +763,7 @@ TEST_F(MinidumpProcessorTest, Test32BitCrashingAddress) {
} // namespace
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump_stackwalk.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump_stackwalk.cc
index acf80972dae..aedd0271da3 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump_stackwalk.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump_stackwalk.cc
@@ -138,7 +138,7 @@ static void SetupOptions(int argc, const char *argv[], Options* options) {
options->machine_readable = false;
options->output_stack_contents = false;
- while ((ch = getopt(argc, (char * const *)argv, "hms")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "hms")) != -1) {
switch (ch) {
case 'h':
Usage(argc, argv, false);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/minidump_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/minidump_unittest.cc
index 036d03f116b..49b007fed49 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/minidump_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/minidump_unittest.cc
@@ -95,9 +95,9 @@ TEST_F(MinidumpTest, TestMinidumpFromFile) {
ASSERT_NE(header, (MDRawHeader*)NULL);
ASSERT_EQ(header->signature, uint32_t(MD_HEADER_SIGNATURE));
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ MinidumpModuleList* md_module_list = minidump.GetModuleList();
ASSERT_TRUE(md_module_list != NULL);
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
+ 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());
@@ -167,7 +167,7 @@ TEST(Dump, OneStream) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
+ const MDRawDirectory* dir = minidump.GetDirectoryEntryAtIndex(0);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ(0xfbb7fa2bU, dir->stream_type);
@@ -203,18 +203,18 @@ TEST(Dump, OneMemory) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
+ const MDRawDirectory* dir = minidump.GetDirectoryEntryAtIndex(0);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ((uint32_t) MD_MEMORY_LIST_STREAM, dir->stream_type);
- MinidumpMemoryList *memory_list = minidump.GetMemoryList();
+ MinidumpMemoryList* memory_list = minidump.GetMemoryList();
ASSERT_TRUE(memory_list != NULL);
ASSERT_EQ(1U, memory_list->region_count());
- MinidumpMemoryRegion *region1 = memory_list->GetMemoryRegionAtIndex(0);
+ MinidumpMemoryRegion* region1 = memory_list->GetMemoryRegionAtIndex(0);
ASSERT_EQ(0x309d68010bd21b2cULL, region1->GetBase());
ASSERT_EQ(15U, region1->GetSize());
- const uint8_t *region1_bytes = region1->GetMemory();
+ const uint8_t* region1_bytes = region1->GetMemory();
ASSERT_TRUE(memcmp("memory contents", region1_bytes, 15) == 0);
}
@@ -257,33 +257,33 @@ TEST(Dump, OneThread) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- MinidumpMemoryList *md_memory_list = minidump.GetMemoryList();
+ MinidumpMemoryList* md_memory_list = minidump.GetMemoryList();
ASSERT_TRUE(md_memory_list != NULL);
ASSERT_EQ(1U, md_memory_list->region_count());
- MinidumpMemoryRegion *md_region = md_memory_list->GetMemoryRegionAtIndex(0);
+ MinidumpMemoryRegion* md_region = md_memory_list->GetMemoryRegionAtIndex(0);
ASSERT_EQ(0x2326a0faU, md_region->GetBase());
ASSERT_EQ(16U, md_region->GetSize());
- const uint8_t *region_bytes = md_region->GetMemory();
+ const uint8_t* region_bytes = md_region->GetMemory();
ASSERT_TRUE(memcmp("stack for thread", region_bytes, 16) == 0);
- MinidumpThreadList *thread_list = minidump.GetThreadList();
+ MinidumpThreadList* thread_list = minidump.GetThreadList();
ASSERT_TRUE(thread_list != NULL);
ASSERT_EQ(1U, thread_list->thread_count());
- MinidumpThread *md_thread = thread_list->GetThreadAtIndex(0);
+ MinidumpThread* md_thread = thread_list->GetThreadAtIndex(0);
ASSERT_TRUE(md_thread != NULL);
uint32_t thread_id;
ASSERT_TRUE(md_thread->GetThreadID(&thread_id));
ASSERT_EQ(0xa898f11bU, thread_id);
- MinidumpMemoryRegion *md_stack = md_thread->GetMemory();
+ MinidumpMemoryRegion* md_stack = md_thread->GetMemory();
ASSERT_TRUE(md_stack != NULL);
ASSERT_EQ(0x2326a0faU, md_stack->GetBase());
ASSERT_EQ(16U, md_stack->GetSize());
- const uint8_t *md_stack_bytes = md_stack->GetMemory();
+ const uint8_t* md_stack_bytes = md_stack->GetMemory();
ASSERT_TRUE(memcmp("stack for thread", md_stack_bytes, 16) == 0);
- MinidumpContext *md_context = md_thread->GetContext();
+ MinidumpContext* md_context = md_thread->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
@@ -291,7 +291,7 @@ TEST(Dump, OneThread) {
ASSERT_TRUE(md_context->GetInstructionPointer(&eip));
EXPECT_EQ(kExpectedEIP, eip);
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
+ const MDRawContextX86* md_raw_context = md_context->GetContextX86();
ASSERT_TRUE(md_raw_context != NULL);
ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
(md_raw_context->context_flags
@@ -425,16 +425,16 @@ TEST(Dump, OneUnloadedModule) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(1);
+ 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 =
+ 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 =
+ 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());
@@ -445,7 +445,7 @@ TEST(Dump, OneUnloadedModule) {
ASSERT_EQ("B1054D2Aada542bd", md_unloaded_module->code_identifier());
ASSERT_EQ("", md_unloaded_module->debug_identifier());
- const MDRawUnloadedModule *md_raw_unloaded_module =
+ 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);
@@ -506,15 +506,15 @@ TEST(Dump, OneModule) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(1);
+ const MDRawDirectory* dir = minidump.GetDirectoryEntryAtIndex(1);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ((uint32_t) MD_MODULE_LIST_STREAM, dir->stream_type);
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ 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);
+ 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());
@@ -524,7 +524,7 @@ TEST(Dump, OneModule) {
ASSERT_EQ("B1054D2Aada542bd", md_module->code_identifier());
ASSERT_EQ("ABCD1234F00DBEEF01020304050607081", md_module->debug_identifier());
- const MDRawModule *md_raw_module = md_module->module();
+ 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);
@@ -588,11 +588,11 @@ TEST(Dump, OneModuleCVELF) {
Minidump minidump(minidump_stream);
ASSERT_TRUE(minidump.Read());
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ 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);
+ 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());
@@ -606,7 +606,7 @@ TEST(Dump, OneModuleCVELF) {
// age appended
ASSERT_EQ("B4CDA95F53101BDF86FAB733B4DF37380", md_module->debug_identifier());
- const MDRawModule *md_raw_module = md_module->module();
+ 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);
@@ -670,11 +670,11 @@ TEST(Dump, CVELFShort) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ 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);
+ 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());
@@ -742,11 +742,11 @@ TEST(Dump, CVELFLong) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ 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);
+ const MinidumpModule* md_module = md_module_list->GetModuleAtIndex(0);
ASSERT_TRUE(md_module != NULL);
// just the build_id, directly
ASSERT_EQ(
@@ -773,11 +773,11 @@ TEST(Dump, OneSystemInfo) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
+ const MDRawDirectory* dir = minidump.GetDirectoryEntryAtIndex(0);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ((uint32_t) MD_SYSTEM_INFO_STREAM, dir->stream_type);
- MinidumpSystemInfo *md_system_info = minidump.GetSystemInfo();
+ MinidumpSystemInfo* md_system_info = minidump.GetSystemInfo();
ASSERT_TRUE(md_system_info != NULL);
ASSERT_EQ("windows", md_system_info->GetOS());
ASSERT_EQ("x86", md_system_info->GetCPU());
@@ -912,7 +912,7 @@ TEST(Dump, BigDump) {
ASSERT_EQ(5U, minidump.GetDirectoryEntryCount());
// Check the threads.
- MinidumpThreadList *thread_list = minidump.GetThreadList();
+ MinidumpThreadList* thread_list = minidump.GetThreadList();
ASSERT_TRUE(thread_list != NULL);
ASSERT_EQ(5U, thread_list->thread_count());
uint32_t thread_id;
@@ -957,7 +957,7 @@ TEST(Dump, BigDump) {
->eip);
// Check the modules.
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
+ MinidumpModuleList* md_module_list = minidump.GetModuleList();
ASSERT_TRUE(md_module_list != NULL);
ASSERT_EQ(3U, md_module_list->module_count());
EXPECT_EQ(0xeb77da57b5d4cbdaULL,
@@ -968,7 +968,7 @@ TEST(Dump, BigDump) {
md_module_list->GetModuleAtIndex(2)->base_address());
// Check unloaded modules
- MinidumpUnloadedModuleList *md_unloaded_module_list =
+ MinidumpUnloadedModuleList* md_unloaded_module_list =
minidump.GetUnloadedModuleList();
ASSERT_TRUE(md_unloaded_module_list != NULL);
ASSERT_EQ(3U, md_unloaded_module_list->module_count());
@@ -979,7 +979,7 @@ TEST(Dump, BigDump) {
EXPECT_EQ(umodule3_base,
md_unloaded_module_list->GetModuleAtIndex(2)->base_address());
- const MinidumpUnloadedModule *umodule =
+ const MinidumpUnloadedModule* umodule =
md_unloaded_module_list->GetModuleForAddress(
umodule1_base + umodule1_size / 2);
EXPECT_EQ(umodule1_base, umodule->base_address());
@@ -1025,22 +1025,22 @@ TEST(Dump, OneMemoryInfo) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
+ const MDRawDirectory* dir = minidump.GetDirectoryEntryAtIndex(0);
ASSERT_TRUE(dir != NULL);
EXPECT_EQ((uint32_t) MD_MEMORY_INFO_LIST_STREAM, dir->stream_type);
- MinidumpMemoryInfoList *info_list = minidump.GetMemoryInfoList();
+ MinidumpMemoryInfoList* info_list = minidump.GetMemoryInfoList();
ASSERT_TRUE(info_list != NULL);
ASSERT_EQ(1U, info_list->info_count());
- const MinidumpMemoryInfo *info1 = info_list->GetMemoryInfoAtIndex(0);
+ const MinidumpMemoryInfo* info1 = info_list->GetMemoryInfoAtIndex(0);
ASSERT_EQ(kBaseAddress, info1->GetBase());
ASSERT_EQ(kRegionSize, info1->GetSize());
ASSERT_TRUE(info1->IsExecutable());
ASSERT_TRUE(info1->IsWritable());
// Should get back the same memory region here.
- const MinidumpMemoryInfo *info2 =
+ const MinidumpMemoryInfo* info2 =
info_list->GetMemoryInfoForAddress(kBaseAddress + kRegionSize / 2);
ASSERT_EQ(kBaseAddress, info2->GetBase());
ASSERT_EQ(kRegionSize, info2->GetSize());
@@ -1083,7 +1083,7 @@ TEST(Dump, OneExceptionX86) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1097,10 +1097,10 @@ TEST(Dump, OneExceptionX86) {
EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
raw_exception->exception_record.exception_address);
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
+ const MDRawContextX86* md_raw_context = md_context->GetContextX86();
ASSERT_TRUE(md_raw_context != NULL);
ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
(md_raw_context->context_flags
@@ -1157,7 +1157,7 @@ TEST(Dump, OneExceptionX86XState) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1171,10 +1171,10 @@ TEST(Dump, OneExceptionX86XState) {
EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
raw_exception->exception_record.exception_address);
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
+ const MDRawContextX86* md_raw_context = md_context->GetContextX86();
ASSERT_TRUE(md_raw_context != NULL);
ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
(md_raw_context->context_flags
@@ -1242,7 +1242,7 @@ TEST(Dump, OneExceptionX86NoCPUFlags) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1256,11 +1256,11 @@ TEST(Dump, OneExceptionX86NoCPUFlags) {
EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
raw_exception->exception_record.exception_address);
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
+ const MDRawContextX86* md_raw_context = md_context->GetContextX86();
ASSERT_TRUE(md_raw_context != NULL);
// Even though the CPU flags were missing from the context_flags, the
@@ -1324,7 +1324,7 @@ TEST(Dump, OneExceptionX86NoCPUFlagsNoSystemInfo) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1341,7 +1341,7 @@ TEST(Dump, OneExceptionX86NoCPUFlagsNoSystemInfo) {
// The context record of the exception is unusable because the context_flags
// don't have CPU type information and at the same time the minidump lacks
// system info stream so it is impossible to deduce the CPU type.
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_EQ(NULL, md_context);
}
@@ -1387,7 +1387,7 @@ TEST(Dump, OneExceptionARM) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1401,10 +1401,10 @@ TEST(Dump, OneExceptionARM) {
EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
raw_exception->exception_record.exception_address);
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());
- const MDRawContextARM *md_raw_context = md_context->GetContextARM();
+ const MDRawContextARM* md_raw_context = md_context->GetContextARM();
ASSERT_TRUE(md_raw_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_ARM_INTEGER,
(md_raw_context->context_flags
@@ -1471,7 +1471,7 @@ TEST(Dump, OneExceptionARMOldFlags) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
@@ -1485,10 +1485,10 @@ TEST(Dump, OneExceptionARMOldFlags) {
EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
raw_exception->exception_record.exception_address);
- MinidumpContext *md_context = md_exception->GetContext();
+ MinidumpContext* md_context = md_exception->GetContext();
ASSERT_TRUE(md_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());
- const MDRawContextARM *md_raw_context = md_context->GetContextARM();
+ const MDRawContextARM* md_raw_context = md_context->GetContextARM();
ASSERT_TRUE(md_raw_context != NULL);
ASSERT_EQ((uint32_t) MD_CONTEXT_ARM_INTEGER,
(md_raw_context->context_flags
@@ -1570,7 +1570,7 @@ TEST(Dump, OneExceptionMIPS) {
ASSERT_TRUE(minidump.Read());
ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
- MinidumpException *md_exception = minidump.GetException();
+ MinidumpException* md_exception = minidump.GetException();
ASSERT_TRUE(md_exception != NULL);
uint32_t thread_id;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.cc b/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.cc
index 025ab883a30..669f11335f0 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.cc
@@ -52,7 +52,7 @@
namespace google_breakpad {
-bool ModuleComparer::Compare(const string &symbol_data) {
+bool ModuleComparer::Compare(const string& symbol_data) {
scoped_ptr<BasicModule> basic_module(new BasicModule("test_module"));
scoped_ptr<FastModule> fast_module(new FastModule("test_module"));
@@ -284,7 +284,7 @@ bool ModuleComparer::CompareCRM(
while (iter1 != basic_crm->map_->end()
&& iter2 != fast_crm->map_.end()) {
ASSERT_TRUE(iter1->first == iter2.GetKey());
- StaticContainedRangeMap<MemAddr, char> *child =
+ StaticContainedRangeMap<MemAddr, char>* child =
new StaticContainedRangeMap<MemAddr, char>(
reinterpret_cast<const char*>(iter2.GetValuePtr()));
ASSERT_TRUE(CompareCRM(iter1->second, child));
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.h b/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.h
index fcbd51775ff..3691081d005 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/module_comparer.h
@@ -64,7 +64,7 @@ class ModuleComparer {
// FastSourceLineResolver loads its module using the serialized memory chunk,
// Then, traverse both modules together and compare underlying data
// return true if both modules contain exactly same data.
- bool Compare(const string &symbol_data);
+ bool Compare(const string& symbol_data);
private:
typedef BasicSourceLineResolver::Module BasicModule;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/module_factory.h b/chromium/third_party/breakpad/breakpad/src/processor/module_factory.h
index 7aa7caa59d9..c6465f42d45 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/module_factory.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/module_factory.h
@@ -46,14 +46,14 @@ class ModuleFactory {
public:
virtual ~ModuleFactory() { };
virtual SourceLineResolverBase::Module* CreateModule(
- const string &name) const = 0;
+ const string& name) const = 0;
};
class BasicModuleFactory : public ModuleFactory {
public:
virtual ~BasicModuleFactory() { }
virtual BasicSourceLineResolver::Module* CreateModule(
- const string &name) const {
+ const string& name) const {
return new BasicSourceLineResolver::Module(name);
}
};
@@ -62,7 +62,7 @@ class FastModuleFactory : public ModuleFactory {
public:
virtual ~FastModuleFactory() { }
virtual FastSourceLineResolver::Module* CreateModule(
- const string &name) const {
+ const string& name) const {
return new FastSourceLineResolver::Module(name);
}
};
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.cc b/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.cc
index 6ac60c1fcf7..04cadc80d57 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.cc
@@ -48,7 +48,7 @@ namespace google_breakpad {
RangeMapSerializer< MemAddr, linked_ptr<BasicSourceLineResolver::Line> >
SimpleSerializer<BasicSourceLineResolver::Function>::range_map_serializer_;
-size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module &module) {
+size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module& module) {
size_t total_size_alloc_ = 0;
// Size of the "is_corrupt" flag.
@@ -80,8 +80,8 @@ size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module &module) {
return total_size_alloc_;
}
-char *ModuleSerializer::Write(const BasicSourceLineResolver::Module &module,
- char *dest) {
+char* ModuleSerializer::Write(const BasicSourceLineResolver::Module& module,
+ char* dest) {
// Write the is_corrupt flag.
dest = SimpleSerializer<bool>::Write(module.is_corrupt_, dest);
// Write header.
@@ -101,12 +101,12 @@ char *ModuleSerializer::Write(const BasicSourceLineResolver::Module &module,
}
char* ModuleSerializer::Serialize(
- const BasicSourceLineResolver::Module &module, unsigned int *size) {
+ const BasicSourceLineResolver::Module& module, unsigned int* size) {
// Compute size of memory to allocate.
unsigned int size_to_alloc = SizeOf(module);
// Allocate memory for serialized data.
- char *serialized_data = new char[size_to_alloc];
+ char* serialized_data = new char[size_to_alloc];
if (!serialized_data) {
BPLOG(ERROR) << "ModuleSerializer: memory allocation failed, "
<< "size to alloc: " << size_to_alloc;
@@ -115,7 +115,7 @@ char* ModuleSerializer::Serialize(
}
// Write serialized data to allocated memory chunk.
- char *end_address = Write(module, serialized_data);
+ char* end_address = Write(module, serialized_data);
// Verify the allocated memory size is equal to the size of data been written.
unsigned int size_written =
static_cast<unsigned int>(end_address - serialized_data);
@@ -131,8 +131,8 @@ char* ModuleSerializer::Serialize(
}
bool ModuleSerializer::SerializeModuleAndLoadIntoFastResolver(
- const BasicSourceLineResolver::ModuleMap::const_iterator &iter,
- FastSourceLineResolver *fast_resolver) {
+ const BasicSourceLineResolver::ModuleMap::const_iterator& iter,
+ FastSourceLineResolver* fast_resolver) {
BPLOG(INFO) << "Converting symbol " << iter->first.c_str();
// Cast SourceLineResolverBase::Module* to BasicSourceLineResolver::Module*.
@@ -161,8 +161,8 @@ bool ModuleSerializer::SerializeModuleAndLoadIntoFastResolver(
}
void ModuleSerializer::ConvertAllModules(
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver) {
+ const BasicSourceLineResolver* basic_resolver,
+ FastSourceLineResolver* fast_resolver) {
// Check for NULL pointer.
if (!basic_resolver || !fast_resolver)
return;
@@ -175,9 +175,9 @@ void ModuleSerializer::ConvertAllModules(
}
bool ModuleSerializer::ConvertOneModule(
- const string &moduleid,
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver) {
+ const string& moduleid,
+ const BasicSourceLineResolver* basic_resolver,
+ FastSourceLineResolver* fast_resolver) {
// Check for NULL pointer.
if (!basic_resolver || !fast_resolver)
return false;
@@ -191,7 +191,7 @@ bool ModuleSerializer::ConvertOneModule(
}
char* ModuleSerializer::SerializeSymbolFileData(
- const string &symbol_data, unsigned int *size) {
+ const string& symbol_data, unsigned int* size) {
scoped_ptr<BasicSourceLineResolver::Module> module(
new BasicSourceLineResolver::Module("no name"));
scoped_array<char> buffer(new char[symbol_data.size() + 1]);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.h b/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.h
index effb009162f..932ac3d76ac 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/module_serializer.h
@@ -61,38 +61,38 @@ class ModuleSerializer {
public:
// Compute the size of memory required to serialize a module. Return the
// total size needed for serialization.
- size_t SizeOf(const BasicSourceLineResolver::Module &module);
+ size_t SizeOf(const BasicSourceLineResolver::Module& module);
// Write a module into an allocated memory chunk with required size.
// Return the "end" of data, i.e., the address after the final byte of data.
- char* Write(const BasicSourceLineResolver::Module &module, char *dest);
+ char* Write(const BasicSourceLineResolver::Module& module, char* dest);
// Serializes a loaded Module object into a chunk of memory data and returns
// the address of memory chunk. If size != NULL, *size is set to the memory
// size allocated for the serialized data.
// Caller takes the ownership of the memory chunk (allocated on heap), and
// owner should call delete [] to free the memory after use.
- char* Serialize(const BasicSourceLineResolver::Module &module,
- unsigned int *size = NULL);
+ char* Serialize(const BasicSourceLineResolver::Module& module,
+ unsigned int* size = NULL);
// Given the string format symbol_data, produces a chunk of serialized data.
// Caller takes ownership of the serialized data (on heap), and owner should
// call delete [] to free the memory after use.
- char* SerializeSymbolFileData(const string &symbol_data,
- unsigned int *size = NULL);
+ char* SerializeSymbolFileData(const string& symbol_data,
+ unsigned int* size = NULL);
// Serializes one loaded module with given moduleid in the basic source line
// resolver, and loads the serialized data into the fast source line resolver.
// Return false if the basic source line doesn't have a module with the given
// moduleid.
- bool ConvertOneModule(const string &moduleid,
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver);
+ bool ConvertOneModule(const string& moduleid,
+ const BasicSourceLineResolver* basic_resolver,
+ FastSourceLineResolver* fast_resolver);
// Serializes all the loaded modules in a basic source line resolver, and
// loads the serialized data into a fast source line resolver.
- void ConvertAllModules(const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver);
+ void ConvertAllModules(const BasicSourceLineResolver* basic_resolver,
+ FastSourceLineResolver* fast_resolver);
private:
// Convenient type names.
@@ -102,8 +102,8 @@ class ModuleSerializer {
// Internal implementation for ConvertOneModule and ConvertAllModules methods.
bool SerializeModuleAndLoadIntoFastResolver(
- const BasicSourceLineResolver::ModuleMap::const_iterator &iter,
- FastSourceLineResolver *fast_resolver);
+ const BasicSourceLineResolver::ModuleMap::const_iterator& iter,
+ FastSourceLineResolver* fast_resolver);
// Number of Maps that Module class contains.
static const int32_t kNumberMaps_ =
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.cc b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.cc
index 839287bdba8..c425b46a193 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.cc
@@ -38,7 +38,7 @@
namespace google_breakpad {
// static
-string PathnameStripper::File(const string &path) {
+string PathnameStripper::File(const string& path) {
string::size_type slash = path.rfind('/');
string::size_type backslash = path.rfind('\\');
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.h b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.h
index 423ca0d05ab..fdf15e03b28 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper.h
@@ -45,7 +45,7 @@ class PathnameStripper {
// Given path, a pathname with components separated by slashes (/) or
// backslashes (\), returns the trailing component, without any separator.
// If path ends in a separator character, returns an empty string.
- static string File(const string &path);
+ static string File(const string& path);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper_unittest.cc
index 1bff4cb0177..61f74fa5ef7 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/pathname_stripper_unittest.cc
@@ -80,7 +80,7 @@ static bool RunTests() {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
return RunTests() ? 0 : 1;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator-inl.h
index d7dbeac2051..f567b1c8dd0 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator-inl.h
@@ -58,19 +58,19 @@ using std::ostringstream;
// before returning failure.
class AutoStackClearer {
public:
- explicit AutoStackClearer(vector<string> *stack) : stack_(stack) {}
+ explicit AutoStackClearer(vector<string>* stack) : stack_(stack) {}
~AutoStackClearer() { stack_->clear(); }
private:
- vector<string> *stack_;
+ vector<string>* stack_;
};
template<typename ValueType>
bool PostfixEvaluator<ValueType>::EvaluateToken(
- const string &token,
- const string &expression,
- DictionaryValidityType *assigned) {
+ const string& token,
+ const string& expression,
+ DictionaryValidityType* assigned) {
// There are enough binary operations that do exactly the same thing
// (other than the specific operation, of course) that it makes sense
// to share as much code as possible.
@@ -203,8 +203,8 @@ bool PostfixEvaluator<ValueType>::EvaluateToken(
template<typename ValueType>
bool PostfixEvaluator<ValueType>::EvaluateInternal(
- const string &expression,
- DictionaryValidityType *assigned) {
+ const string& expression,
+ DictionaryValidityType* assigned) {
// Tokenize, splitting on whitespace.
istringstream stream(expression);
string token;
@@ -231,8 +231,8 @@ bool PostfixEvaluator<ValueType>::EvaluateInternal(
}
template<typename ValueType>
-bool PostfixEvaluator<ValueType>::Evaluate(const string &expression,
- DictionaryValidityType *assigned) {
+bool PostfixEvaluator<ValueType>::Evaluate(const string& expression,
+ DictionaryValidityType* assigned) {
// Ensure that the stack is cleared before returning.
AutoStackClearer clearer(&stack_);
@@ -250,8 +250,8 @@ bool PostfixEvaluator<ValueType>::Evaluate(const string &expression,
}
template<typename ValueType>
-bool PostfixEvaluator<ValueType>::EvaluateForValue(const string &expression,
- ValueType *result) {
+bool PostfixEvaluator<ValueType>::EvaluateForValue(const string& expression,
+ ValueType* result) {
// Ensure that the stack is cleared before returning.
AutoStackClearer clearer(&stack_);
@@ -271,7 +271,7 @@ bool PostfixEvaluator<ValueType>::EvaluateForValue(const string &expression,
template<typename ValueType>
typename PostfixEvaluator<ValueType>::PopResult
PostfixEvaluator<ValueType>::PopValueOrIdentifier(
- ValueType *value, string *identifier) {
+ ValueType* value, string* identifier) {
// There needs to be at least one element on the stack to pop.
if (!stack_.size())
return POP_RESULT_FAIL;
@@ -314,7 +314,7 @@ PostfixEvaluator<ValueType>::PopValueOrIdentifier(
template<typename ValueType>
-bool PostfixEvaluator<ValueType>::PopValue(ValueType *value) {
+bool PostfixEvaluator<ValueType>::PopValue(ValueType* value) {
ValueType literal = ValueType();
string token;
PopResult result;
@@ -343,14 +343,14 @@ bool PostfixEvaluator<ValueType>::PopValue(ValueType *value) {
template<typename ValueType>
-bool PostfixEvaluator<ValueType>::PopValues(ValueType *value1,
- ValueType *value2) {
+bool PostfixEvaluator<ValueType>::PopValues(ValueType* value1,
+ ValueType* value2) {
return PopValue(value2) && PopValue(value1);
}
template<typename ValueType>
-void PostfixEvaluator<ValueType>::PushValue(const ValueType &value) {
+void PostfixEvaluator<ValueType>::PushValue(const ValueType& value) {
ostringstream token_stream;
token_stream << value;
stack_.push_back(token_stream.str());
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator.h b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator.h
index 94b66190d5d..d847a9b166b 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator.h
@@ -95,7 +95,7 @@ class PostfixEvaluator {
// (^) will not be supported. |dictionary| may be NULL, but evaluation
// will fail in that case unless set_dictionary is used before calling
// Evaluate.
- PostfixEvaluator(DictionaryType *dictionary, const MemoryRegion *memory)
+ PostfixEvaluator(DictionaryType* dictionary, const MemoryRegion* memory)
: dictionary_(dictionary), memory_(memory), stack_() {}
// Evaluate the expression, starting with an empty stack. The results of
@@ -105,18 +105,18 @@ class PostfixEvaluator {
// non-NULL, any keys set in the dictionary as a result of evaluation
// will also be set to true in assigned, providing a way to determine if
// an expression modifies any of its input variables.
- bool Evaluate(const string &expression, DictionaryValidityType *assigned);
+ bool Evaluate(const string& expression, DictionaryValidityType* assigned);
// Like Evaluate, but provides the value left on the stack to the
// caller. If evaluation succeeds and leaves exactly one value on
// the stack, pop that value, store it in *result, and return true.
// Otherwise, return false.
- bool EvaluateForValue(const string &expression, ValueType *result);
+ bool EvaluateForValue(const string& expression, ValueType* result);
DictionaryType* dictionary() const { return dictionary_; }
// Reset the dictionary. PostfixEvaluator does not take ownership.
- void set_dictionary(DictionaryType *dictionary) {dictionary_ = dictionary; }
+ void set_dictionary(DictionaryType* dictionary) {dictionary_ = dictionary; }
private:
// Return values for PopValueOrIdentifier
@@ -132,40 +132,40 @@ class PostfixEvaluator {
// if the topmost entry is a constant or variable identifier, and sets
// |identifier| accordingly. Returns POP_RESULT_FAIL on failure, such
// as when the stack is empty.
- PopResult PopValueOrIdentifier(ValueType *value, string *identifier);
+ PopResult PopValueOrIdentifier(ValueType* value, string* identifier);
// Retrieves the topmost value on the stack. If the topmost entry is
// an identifier, the dictionary is queried for the identifier's value.
// Returns false on failure, such as when the stack is empty or when
// a nonexistent identifier is named.
- bool PopValue(ValueType *value);
+ bool PopValue(ValueType* value);
// Retrieves the top two values on the stack, in the style of PopValue.
// value2 is popped before value1, so that value1 corresponds to the
// entry that was pushed prior to value2. Returns false on failure.
- bool PopValues(ValueType *value1, ValueType *value2);
+ bool PopValues(ValueType* value1, ValueType* value2);
// Pushes a new value onto the stack.
- void PushValue(const ValueType &value);
+ void PushValue(const ValueType& value);
// Evaluate expression, updating *assigned if it is non-zero. Return
// true if evaluation completes successfully. Do not clear the stack
// upon successful evaluation.
- bool EvaluateInternal(const string &expression,
- DictionaryValidityType *assigned);
+ bool EvaluateInternal(const string& expression,
+ DictionaryValidityType* assigned);
- bool EvaluateToken(const string &token,
- const string &expression,
- DictionaryValidityType *assigned);
+ bool EvaluateToken(const string& token,
+ const string& expression,
+ DictionaryValidityType* assigned);
// The dictionary mapping constant and variable identifiers (strings) to
// values. Keys beginning with '$' are treated as variable names, and
// PostfixEvaluator is free to create and modify these keys. Weak pointer.
- DictionaryType *dictionary_;
+ DictionaryType* dictionary_;
// If non-NULL, the MemoryRegion used for dereference (^) operations.
// If NULL, dereferencing is unsupported and will fail. Weak pointer.
- const MemoryRegion *memory_;
+ const MemoryRegion* memory_;
// The stack contains state information as execution progresses. Values
// are pushed on to it as the expression string is read and as operations
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator_unittest.cc
index f1189828499..5a01584a0e1 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/postfix_evaluator_unittest.cc
@@ -60,19 +60,19 @@ class FakeMemoryRegion : public MemoryRegion {
public:
virtual uint64_t GetBase() const { return 0; }
virtual uint32_t GetSize() const { return 0; }
- virtual bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
+ virtual bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
*value = address + 1;
return true;
}
- virtual bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
+ virtual bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
*value = address + 1;
return true;
}
- virtual bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
+ virtual bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
*value = address + 1;
return true;
}
- virtual bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
+ virtual bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
*value = address + 1;
return true;
}
@@ -94,17 +94,17 @@ struct EvaluateTest {
struct EvaluateTestSet {
// The dictionary used for all tests in the set.
- PostfixEvaluator<unsigned int>::DictionaryType *dictionary;
+ PostfixEvaluator<unsigned int>::DictionaryType* dictionary;
// The list of tests.
- const EvaluateTest *evaluate_tests;
+ const EvaluateTest* evaluate_tests;
// The number of tests.
unsigned int evaluate_test_count;
// Identifiers and their expected values upon completion of the Evaluate
// tests in the set.
- map<string, unsigned int> *validate_data;
+ map<string, unsigned int>* validate_data;
};
@@ -227,9 +227,9 @@ static bool RunTests() {
for (unsigned int evaluate_test_set_index = 0;
evaluate_test_set_index < evaluate_test_set_count;
++evaluate_test_set_index) {
- EvaluateTestSet *evaluate_test_set =
+ EvaluateTestSet* evaluate_test_set =
&evaluate_test_sets[evaluate_test_set_index];
- const EvaluateTest *evaluate_tests = evaluate_test_set->evaluate_tests;
+ const EvaluateTest* evaluate_tests = evaluate_test_set->evaluate_tests;
unsigned int evaluate_test_count = evaluate_test_set->evaluate_test_count;
// The same dictionary will be used for each test in the set. Earlier
@@ -242,7 +242,7 @@ static bool RunTests() {
for (unsigned int evaluate_test_index = 0;
evaluate_test_index < evaluate_test_count;
++evaluate_test_index) {
- const EvaluateTest *evaluate_test = &evaluate_tests[evaluate_test_index];
+ const EvaluateTest* evaluate_test = &evaluate_tests[evaluate_test_index];
// Do the test.
bool result = postfix_evaluator.Evaluate(evaluate_test->expression,
@@ -344,7 +344,7 @@ static bool RunTests() {
postfix_evaluator.set_dictionary(&dictionary_2);
for (int i = 0; i < evaluate_for_value_tests_2_size; i++) {
- const EvaluateForValueTest *test = &evaluate_for_value_tests_2[i];
+ const EvaluateForValueTest* test = &evaluate_for_value_tests_2[i];
unsigned int result;
if (postfix_evaluator.EvaluateForValue(test->expression, &result)
!= test->evaluable) {
@@ -396,7 +396,7 @@ static bool RunTests() {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
return RunTests() ? 0 : 1;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/process_state.cc b/chromium/third_party/breakpad/breakpad/src/processor/process_state.cc
index 43c4a4b8b04..c9269e418d8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/process_state.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/process_state.cc
@@ -51,7 +51,7 @@ void ProcessState::Clear() {
crash_address_ = 0;
assertion_.clear();
requesting_thread_ = -1;
- for (vector<CallStack *>::const_iterator iterator = threads_.begin();
+ for (vector<CallStack*>::const_iterator iterator = threads_.begin();
iterator != threads_.end();
++iterator) {
delete *iterator;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/range_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/range_map-inl.h
index 4d3b0eb96fd..6bfc72554df 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/range_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/range_map-inl.h
@@ -47,16 +47,16 @@
namespace google_breakpad {
template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
- const AddressType &size,
- const EntryType &entry) {
+bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType& base,
+ const AddressType& size,
+ const EntryType& entry) {
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) {
+ const AddressType& base, const AddressType& delta,
+ const AddressType& size, const EntryType& entry) {
AddressType high = base + (size - 1);
// Check for undersize or overflow.
@@ -181,8 +181,8 @@ bool RangeMap<AddressType, EntryType>::StoreRangeInternal(
template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, EntryType *entry, AddressType *entry_base,
- AddressType *entry_delta, 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);
@@ -212,8 +212,8 @@ 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_delta, 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);
@@ -245,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_delta, 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);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/range_map.h b/chromium/third_party/breakpad/breakpad/src/processor/range_map.h
index 33f32973496..baea91cf485 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/range_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/range_map.h
@@ -78,17 +78,17 @@ class RangeMap {
// 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);
+ 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, 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_delta,
- AddressType *entry_size) const;
+ bool RetrieveRange(const AddressType& address, EntryType* entry,
+ 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
@@ -97,9 +97,9 @@ class RangeMap {
// 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_delta,
- AddressType *entry_size) const;
+ bool RetrieveNearestRange(const AddressType& address, EntryType* entry,
+ 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
@@ -110,9 +110,9 @@ class RangeMap {
// 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_delta,
- AddressType *entry_size) const;
+ bool RetrieveRangeAtIndex(int index, EntryType* entry,
+ AddressType* entry_base, AddressType* entry_delta,
+ AddressType* entry_size) const;
// Returns the number of ranges stored in the RangeMap.
int GetCount() const;
@@ -128,13 +128,13 @@ class RangeMap {
// 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);
+ bool StoreRangeInternal(const AddressType& base, const AddressType& delta,
+ const AddressType& size, const EntryType& entry);
class Range {
public:
- Range(const AddressType &base, const AddressType &delta,
- const EntryType &entry)
+ Range(const AddressType& base, const AddressType& delta,
+ const EntryType& entry)
: base_(base), delta_(delta), entry_(entry) {}
AddressType base() const { return base_; }
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/range_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/range_map_unittest.cc
index 31b89e5de30..0f1c71319f8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/range_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/range_map_unittest.cc
@@ -92,7 +92,7 @@ struct RangeTest {
// sequence on the same RangeMap.
struct RangeTestSet {
// An array of RangeTests
- const RangeTest *range_tests;
+ const RangeTest* range_tests;
// The number of tests in the set
unsigned int range_test_count;
@@ -102,7 +102,7 @@ struct RangeTestSet {
// StoreTest uses the data in a RangeTest and calls StoreRange on the
// test RangeMap. It returns true if the expected result occurred, and
// false if something else happened.
-static bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
+static bool StoreTest(TestMap* range_map, const RangeTest* range_test) {
linked_ptr<CountedObject> object(new CountedObject(range_test->id));
bool stored = range_map->StoreRange(range_test->address,
range_test->size,
@@ -126,7 +126,7 @@ static bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
// map entry at the specified range,) it returns true, otherwise, it returns
// false. RetrieveTest will check the values around the base address and
// the high address of a range to guard against off-by-one errors.
-static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
+static bool RetrieveTest(TestMap* range_map, const RangeTest* range_test) {
for (unsigned int side = 0; side <= 1; ++side) {
// When side == 0, check the low side (base address) of each range.
// When side == 1, check the high side (base + size) of each range.
@@ -270,9 +270,9 @@ static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
// and verifying that each call returns a different object than the previous
// call, and that ranges are returned with increasing base addresses. Returns
// false if the test fails.
-static bool RetrieveIndexTest(TestMap *range_map, int set) {
+static bool RetrieveIndexTest(TestMap* range_map, int set) {
linked_ptr<CountedObject> object;
- CountedObject *last_object = NULL;
+ CountedObject* last_object = NULL;
AddressType last_base = 0;
int object_count = range_map->GetCount();
@@ -469,7 +469,7 @@ static bool RunTests() {
for (unsigned int range_test_set_index = 0;
range_test_set_index < range_test_set_count;
++range_test_set_index) {
- const RangeTest *range_tests =
+ const RangeTest* range_tests =
range_test_sets[range_test_set_index].range_tests;
unsigned int range_test_count =
range_test_sets[range_test_set_index].range_test_count;
@@ -480,7 +480,7 @@ static bool RunTests() {
for (unsigned int range_test_index = 0;
range_test_index < range_test_count;
++range_test_index) {
- const RangeTest *range_test = &range_tests[range_test_index];
+ const RangeTest* range_test = &range_tests[range_test_index];
if (!StoreTest(range_map.get(), range_test))
return false;
@@ -512,7 +512,7 @@ static bool RunTests() {
for (unsigned int range_test_index = 0;
range_test_index < range_test_count;
++range_test_index) {
- const RangeTest *range_test = &range_tests[range_test_index];
+ const RangeTest* range_test = &range_tests[range_test_index];
if (!RetrieveTest(range_map.get(), range_test))
return false;
}
@@ -552,7 +552,7 @@ static bool RunTests() {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
return RunTests() ? 0 : 1;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer-inl.h
index 606bb3cead5..cb1a04081e4 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer-inl.h
@@ -56,12 +56,12 @@ class SimpleSerializer<bool> {
public:
static size_t SizeOf(bool boolean) { return 1; }
- static char *Write(bool boolean, char *dest) {
+ static char* Write(bool boolean, char* dest) {
*dest = static_cast<char>(boolean? 255 : 0);
return ++dest;
}
- static const char *Read(const char *source, bool *value) {
+ static const char* Read(const char* source, bool* value) {
*value = ((*source) == 0 ? false : true);
return ++source;
}
@@ -71,9 +71,9 @@ class SimpleSerializer<bool> {
template<>
class SimpleSerializer<string> {
public:
- static size_t SizeOf(const string &str) { return str.size() + 1; }
+ static size_t SizeOf(const string& str) { return str.size() + 1; }
- static char *Write(const string &str, char *dest) {
+ static char* Write(const string& str, char* dest) {
strcpy(dest, str.c_str());
return dest + SizeOf(str);
}
@@ -83,11 +83,11 @@ class SimpleSerializer<string> {
template<>
class SimpleSerializer<const char*> {
public:
- static size_t SizeOf(const char *cstring) {
+ static size_t SizeOf(const char* cstring) {
return strlen(cstring) + 1;
}
- static char *Write(const char *cstring, char *dest) {
+ static char* Write(const char* cstring, char* dest) {
strcpy(dest, cstring);
return dest + SizeOf(cstring);
}
@@ -98,13 +98,13 @@ template<>
class SimpleSerializer<BasicSourceLineResolver::Line> {
typedef BasicSourceLineResolver::Line Line;
public:
- static size_t SizeOf(const Line &line) {
+ static size_t SizeOf(const Line& line) {
return SimpleSerializer<MemAddr>::SizeOf(line.address)
+ SimpleSerializer<MemAddr>::SizeOf(line.size)
+ SimpleSerializer<int32_t>::SizeOf(line.source_file_id)
+ SimpleSerializer<int32_t>::SizeOf(line.line);
}
- static char *Write(const Line &line, char *dest) {
+ static char* Write(const Line& line, char* dest) {
dest = SimpleSerializer<MemAddr>::Write(line.address, dest);
dest = SimpleSerializer<MemAddr>::Write(line.size, dest);
dest = SimpleSerializer<int32_t>::Write(line.source_file_id, dest);
@@ -118,12 +118,12 @@ template<>
class SimpleSerializer<BasicSourceLineResolver::PublicSymbol> {
typedef BasicSourceLineResolver::PublicSymbol PublicSymbol;
public:
- static size_t SizeOf(const PublicSymbol &pubsymbol) {
+ static size_t SizeOf(const PublicSymbol& pubsymbol) {
return SimpleSerializer<string>::SizeOf(pubsymbol.name)
+ SimpleSerializer<MemAddr>::SizeOf(pubsymbol.address)
+ SimpleSerializer<int32_t>::SizeOf(pubsymbol.parameter_size);
}
- static char *Write(const PublicSymbol &pubsymbol, char *dest) {
+ static char* Write(const PublicSymbol& pubsymbol, char* dest) {
dest = SimpleSerializer<string>::Write(pubsymbol.name, dest);
dest = SimpleSerializer<MemAddr>::Write(pubsymbol.address, dest);
dest = SimpleSerializer<int32_t>::Write(pubsymbol.parameter_size, dest);
@@ -135,7 +135,7 @@ class SimpleSerializer<BasicSourceLineResolver::PublicSymbol> {
template<>
class SimpleSerializer<WindowsFrameInfo> {
public:
- static size_t SizeOf(const WindowsFrameInfo &wfi) {
+ static size_t SizeOf(const WindowsFrameInfo& wfi) {
unsigned int size = 0;
size += sizeof(int32_t); // wfi.type_
size += SimpleSerializer<int32_t>::SizeOf(wfi.valid);
@@ -149,7 +149,7 @@ class SimpleSerializer<WindowsFrameInfo> {
size += SimpleSerializer<string>::SizeOf(wfi.program_string);
return size;
}
- static char *Write(const WindowsFrameInfo &wfi, char *dest) {
+ static char* Write(const WindowsFrameInfo& wfi, char* dest) {
dest = SimpleSerializer<int32_t>::Write(
static_cast<const int32_t>(wfi.type_), dest);
dest = SimpleSerializer<int32_t>::Write(wfi.valid, dest);
@@ -170,11 +170,11 @@ template<>
class SimpleSerializer< linked_ptr<BasicSourceLineResolver::Line> > {
typedef BasicSourceLineResolver::Line Line;
public:
- static size_t SizeOf(const linked_ptr<Line> &lineptr) {
+ static size_t SizeOf(const linked_ptr<Line>& lineptr) {
if (lineptr.get() == NULL) return 0;
return SimpleSerializer<Line>::SizeOf(*(lineptr.get()));
}
- static char *Write(const linked_ptr<Line> &lineptr, char *dest) {
+ static char* Write(const linked_ptr<Line>& lineptr, char* dest) {
if (lineptr.get())
dest = SimpleSerializer<Line>::Write(*(lineptr.get()), dest);
return dest;
@@ -187,7 +187,7 @@ class SimpleSerializer<BasicSourceLineResolver::Function> {
typedef BasicSourceLineResolver::Function Function;
typedef BasicSourceLineResolver::Line Line;
public:
- static size_t SizeOf(const Function &func) {
+ static size_t SizeOf(const Function& func) {
unsigned int size = 0;
size += SimpleSerializer<string>::SizeOf(func.name);
size += SimpleSerializer<MemAddr>::SizeOf(func.address);
@@ -197,7 +197,7 @@ class SimpleSerializer<BasicSourceLineResolver::Function> {
return size;
}
- static char *Write(const Function &func, char *dest) {
+ static char* Write(const Function& func, char* dest) {
dest = SimpleSerializer<string>::Write(func.name, dest);
dest = SimpleSerializer<MemAddr>::Write(func.address, dest);
dest = SimpleSerializer<MemAddr>::Write(func.size, dest);
@@ -214,12 +214,12 @@ template<>
class SimpleSerializer< linked_ptr<BasicSourceLineResolver::Function> > {
typedef BasicSourceLineResolver::Function Function;
public:
- static size_t SizeOf(const linked_ptr<Function> &func) {
+ static size_t SizeOf(const linked_ptr<Function>& func) {
if (!func.get()) return 0;
return SimpleSerializer<Function>::SizeOf(*(func.get()));
}
- static char *Write(const linked_ptr<Function> &func, char *dest) {
+ static char* Write(const linked_ptr<Function>& func, char* dest) {
if (func.get())
dest = SimpleSerializer<Function>::Write(*(func.get()), dest);
return dest;
@@ -230,11 +230,11 @@ template<>
class SimpleSerializer< linked_ptr<BasicSourceLineResolver::PublicSymbol> > {
typedef BasicSourceLineResolver::PublicSymbol PublicSymbol;
public:
- static size_t SizeOf(const linked_ptr<PublicSymbol> &pubsymbol) {
+ static size_t SizeOf(const linked_ptr<PublicSymbol>& pubsymbol) {
if (pubsymbol.get() == NULL) return 0;
return SimpleSerializer<PublicSymbol>::SizeOf(*(pubsymbol.get()));
}
- static char *Write(const linked_ptr<PublicSymbol> &pubsymbol, char *dest) {
+ static char* Write(const linked_ptr<PublicSymbol>& pubsymbol, char* dest) {
if (pubsymbol.get())
dest = SimpleSerializer<PublicSymbol>::Write(*(pubsymbol.get()), dest);
return dest;
@@ -244,11 +244,11 @@ class SimpleSerializer< linked_ptr<BasicSourceLineResolver::PublicSymbol> > {
template<>
class SimpleSerializer< linked_ptr<WindowsFrameInfo> > {
public:
- static size_t SizeOf(const linked_ptr<WindowsFrameInfo> &wfi) {
+ static size_t SizeOf(const linked_ptr<WindowsFrameInfo>& wfi) {
if (wfi.get() == NULL) return 0;
return SimpleSerializer<WindowsFrameInfo>::SizeOf(*(wfi.get()));
}
- static char *Write(const linked_ptr<WindowsFrameInfo> &wfi, char *dest) {
+ static char* Write(const linked_ptr<WindowsFrameInfo>& wfi, char* dest) {
if (wfi.get())
dest = SimpleSerializer<WindowsFrameInfo>::Write(*(wfi.get()), dest);
return dest;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer.h b/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer.h
index 275f51ce36b..9e51d8067bf 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/simple_serializer.h
@@ -49,10 +49,10 @@ typedef uint64_t MemAddr;
template<class Type> class SimpleSerializer {
public:
// Calculate and return the size of the 'item'.
- static size_t SizeOf(const Type &item) { return sizeof(item); }
+ static size_t SizeOf(const Type& item) { return sizeof(item); }
// Write 'item' to memory location 'dest', and return to the "end" address of
// data written, i.e., the address after the final byte written.
- static char *Write(const Type &item, char *dest) {
+ static char* Write(const Type& item, char* dest) {
new (dest) Type(item);
return dest + SizeOf(item);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.cc b/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.cc
index bc5ebb687b9..cdc3efbf9cb 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.cc
@@ -52,14 +52,14 @@
namespace google_breakpad {
-static bool file_exists(const string &file_name) {
+static bool file_exists(const string& file_name) {
struct stat sb;
return stat(file_name.c_str(), &sb) == 0;
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
- const CodeModule *module, const SystemInfo *system_info,
- string *symbol_file) {
+ const CodeModule* module, const SystemInfo* system_info,
+ string* symbol_file) {
BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFile "
"requires |symbol_file|";
assert(symbol_file);
@@ -77,10 +77,10 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
+ const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data) {
assert(symbol_data);
symbol_data->clear();
@@ -96,11 +96,11 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetCStringSymbolData(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
+ const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size) {
assert(symbol_data);
assert(symbol_data_size);
@@ -123,13 +123,13 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetCStringSymbolData(
return s;
}
-void SimpleSymbolSupplier::FreeSymbolData(const CodeModule *module) {
+void SimpleSymbolSupplier::FreeSymbolData(const CodeModule* module) {
if (!module) {
BPLOG(INFO) << "Cannot free symbol data buffer for NULL module";
return;
}
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
+ map<string, char*>::iterator it = memory_buffers_.find(module->code_file());
if (it == memory_buffers_.end()) {
BPLOG(INFO) << "Cannot find symbol data buffer for module "
<< module->code_file();
@@ -140,8 +140,8 @@ void SimpleSymbolSupplier::FreeSymbolData(const CodeModule *module) {
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPathFromRoot(
- const CodeModule *module, const SystemInfo *system_info,
- const string &root_path, string *symbol_file) {
+ const CodeModule* module, const SystemInfo* system_info,
+ const string& root_path, string* symbol_file) {
BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFileAtPath "
"requires |symbol_file|";
assert(symbol_file);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.h b/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.h
index 0cde85cdcd8..3a65c7e600c 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/simple_symbol_supplier.h
@@ -94,44 +94,44 @@ class SimpleSymbolSupplier : public SymbolSupplier {
public:
// Creates a new SimpleSymbolSupplier, using path as the root path where
// symbols are stored.
- explicit SimpleSymbolSupplier(const string &path) : paths_(1, path) {}
+ explicit SimpleSymbolSupplier(const string& path) : paths_(1, path) {}
// Creates a new SimpleSymbolSupplier, using paths as a list of root
// paths where symbols may be stored.
- explicit SimpleSymbolSupplier(const vector<string> &paths) : paths_(paths) {}
+ explicit SimpleSymbolSupplier(const vector<string>& paths) : paths_(paths) {}
virtual ~SimpleSymbolSupplier() {}
// Returns the path to the symbol file for the given module. See the
// description above.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file);
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data);
// Allocates data buffer on heap and writes symbol data into buffer.
// Symbol supplier ALWAYS takes ownership of the data buffer.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
+ virtual SymbolResult GetCStringSymbolData(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size);
// Free the data buffer allocated in the above GetCStringSymbolData();
- virtual void FreeSymbolData(const CodeModule *module);
+ virtual void FreeSymbolData(const CodeModule* module);
protected:
- SymbolResult GetSymbolFileAtPathFromRoot(const CodeModule *module,
- const SystemInfo *system_info,
- const string &root_path,
- string *symbol_file);
+ SymbolResult GetSymbolFileAtPathFromRoot(const CodeModule* module,
+ const SystemInfo* system_info,
+ const string& root_path,
+ string* symbol_file);
private:
- map<string, char *> memory_buffers_;
+ map<string, char*> memory_buffers_;
vector<string> paths_;
};
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base.cc b/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base.cc
index 6eff1f99180..45a06cf3c44 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base.cc
@@ -51,7 +51,7 @@ using std::make_pair;
namespace google_breakpad {
SourceLineResolverBase::SourceLineResolverBase(
- ModuleFactory *module_factory)
+ ModuleFactory* module_factory)
: modules_(new ModuleMap),
corrupt_modules_(new ModuleSet),
memory_buffers_(new MemoryMap),
@@ -85,9 +85,9 @@ SourceLineResolverBase::~SourceLineResolverBase() {
module_factory_ = NULL;
}
-bool SourceLineResolverBase::ReadSymbolFile(const string &map_file,
- char **symbol_data,
- size_t *symbol_data_size) {
+bool SourceLineResolverBase::ReadSymbolFile(const string& map_file,
+ char** symbol_data,
+ size_t* symbol_data_size) {
if (symbol_data == NULL || symbol_data_size == NULL) {
BPLOG(ERROR) << "Could not Read file into Null memory pointer";
return false;
@@ -117,7 +117,7 @@ bool SourceLineResolverBase::ReadSymbolFile(const string &map_file,
BPLOG(INFO) << "Opening " << map_file;
- FILE *f = fopen(map_file.c_str(), "rt");
+ FILE* f = fopen(map_file.c_str(), "rt");
if (!f) {
string error_string;
error_code = ErrnoString(&error_string);
@@ -148,8 +148,8 @@ bool SourceLineResolverBase::ReadSymbolFile(const string &map_file,
return true;
}
-bool SourceLineResolverBase::LoadModule(const CodeModule *module,
- const string &map_file) {
+bool SourceLineResolverBase::LoadModule(const CodeModule* module,
+ const string& map_file) {
if (module == NULL)
return false;
@@ -163,7 +163,7 @@ bool SourceLineResolverBase::LoadModule(const CodeModule *module,
BPLOG(INFO) << "Loading symbols for module " << module->code_file()
<< " from " << map_file;
- char *memory_buffer;
+ char* memory_buffer;
size_t memory_buffer_size;
if (!ReadSymbolFile(map_file, &memory_buffer, &memory_buffer_size))
return false;
@@ -184,7 +184,7 @@ bool SourceLineResolverBase::LoadModule(const CodeModule *module,
}
bool SourceLineResolverBase::LoadModuleUsingMapBuffer(
- const CodeModule *module, const string &map_buffer) {
+ const CodeModule* module, const string& map_buffer) {
if (module == NULL)
return false;
@@ -196,7 +196,7 @@ bool SourceLineResolverBase::LoadModuleUsingMapBuffer(
}
size_t memory_buffer_size = map_buffer.size() + 1;
- char *memory_buffer = new char[memory_buffer_size];
+ char* memory_buffer = new char[memory_buffer_size];
if (memory_buffer == NULL) {
BPLOG(ERROR) << "Could not allocate memory for " << module->code_file();
return false;
@@ -220,8 +220,8 @@ bool SourceLineResolverBase::LoadModuleUsingMapBuffer(
}
bool SourceLineResolverBase::LoadModuleUsingMemoryBuffer(
- const CodeModule *module,
- char *memory_buffer,
+ const CodeModule* module,
+ char* memory_buffer,
size_t memory_buffer_size) {
if (!module)
return false;
@@ -236,7 +236,7 @@ bool SourceLineResolverBase::LoadModuleUsingMemoryBuffer(
BPLOG(INFO) << "Loading symbols for module " << module->code_file()
<< " from memory buffer";
- Module *basic_module = module_factory_->CreateModule(module->code_file());
+ Module* basic_module = module_factory_->CreateModule(module->code_file());
// Ownership of memory is NOT transfered to Module::LoadMapFromMemory().
if (!basic_module->LoadMapFromMemory(memory_buffer, memory_buffer_size)) {
@@ -259,13 +259,13 @@ bool SourceLineResolverBase::ShouldDeleteMemoryBufferAfterLoadModule() {
return true;
}
-void SourceLineResolverBase::UnloadModule(const CodeModule *code_module) {
+void SourceLineResolverBase::UnloadModule(const CodeModule* code_module) {
if (!code_module)
return;
ModuleMap::iterator mod_iter = modules_->find(code_module->code_file());
if (mod_iter != modules_->end()) {
- Module *symbol_module = mod_iter->second;
+ Module* symbol_module = mod_iter->second;
delete symbol_module;
corrupt_modules_->erase(mod_iter->first);
modules_->erase(mod_iter);
@@ -283,19 +283,19 @@ void SourceLineResolverBase::UnloadModule(const CodeModule *code_module) {
}
}
-bool SourceLineResolverBase::HasModule(const CodeModule *module) {
+bool SourceLineResolverBase::HasModule(const CodeModule* module) {
if (!module)
return false;
return modules_->find(module->code_file()) != modules_->end();
}
-bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule *module) {
+bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule* module) {
if (!module)
return false;
return corrupt_modules_->find(module->code_file()) != corrupt_modules_->end();
}
-void SourceLineResolverBase::FillSourceLineInfo(StackFrame *frame) {
+void SourceLineResolverBase::FillSourceLineInfo(StackFrame* frame) {
if (frame->module) {
ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
if (it != modules_->end()) {
@@ -304,8 +304,8 @@ void SourceLineResolverBase::FillSourceLineInfo(StackFrame *frame) {
}
}
-WindowsFrameInfo *SourceLineResolverBase::FindWindowsFrameInfo(
- const StackFrame *frame) {
+WindowsFrameInfo* SourceLineResolverBase::FindWindowsFrameInfo(
+ const StackFrame* frame) {
if (frame->module) {
ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
if (it != modules_->end()) {
@@ -315,8 +315,8 @@ WindowsFrameInfo *SourceLineResolverBase::FindWindowsFrameInfo(
return NULL;
}
-CFIFrameInfo *SourceLineResolverBase::FindCFIFrameInfo(
- const StackFrame *frame) {
+CFIFrameInfo* SourceLineResolverBase::FindCFIFrameInfo(
+ const StackFrame* frame) {
if (frame->module) {
ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
if (it != modules_->end()) {
@@ -327,12 +327,12 @@ CFIFrameInfo *SourceLineResolverBase::FindCFIFrameInfo(
}
bool SourceLineResolverBase::CompareString::operator()(
- const string &s1, const string &s2) const {
+ const string& s1, const string& s2) const {
return strcmp(s1.c_str(), s2.c_str()) < 0;
}
bool SourceLineResolverBase::Module::ParseCFIRuleSet(
- const string &rule_set, CFIFrameInfo *frame_info) const {
+ const string& rule_set, CFIFrameInfo* frame_info) const {
CFIFrameInfoParseHandler handler(frame_info);
CFIRuleParser parser(&handler);
return parser.Parse(rule_set);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base_types.h b/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base_types.h
index ca744e00153..db9f7b8e265 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base_types.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/source_line_resolver_base_types.h
@@ -56,14 +56,14 @@ namespace google_breakpad {
class SourceLineResolverBase::AutoFileCloser {
public:
- explicit AutoFileCloser(FILE *file) : file_(file) {}
+ explicit AutoFileCloser(FILE* file) : file_(file) {}
~AutoFileCloser() {
if (file_)
fclose(file_);
}
private:
- FILE *file_;
+ FILE* file_;
};
struct SourceLineResolverBase::Line {
@@ -82,7 +82,7 @@ struct SourceLineResolverBase::Line {
struct SourceLineResolverBase::Function {
Function() { }
- Function(const string &function_name,
+ Function(const string& function_name,
MemAddr function_address,
MemAddr code_size,
int set_parameter_size,
@@ -133,7 +133,7 @@ class SourceLineResolverBase::Module {
// The passed in |memory buffer| is of size |memory_buffer_size|. If it is
// not null terminated, LoadMapFromMemory will null terminate it by modifying
// the passed in buffer.
- virtual bool LoadMapFromMemory(char *memory_buffer,
+ virtual bool LoadMapFromMemory(char* memory_buffer,
size_t memory_buffer_size) = 0;
// Tells whether the loaded symbol data is corrupt. Return value is
@@ -142,24 +142,24 @@ class SourceLineResolverBase::Module {
// Looks up the given relative address, and fills the StackFrame struct
// with the result.
- virtual void LookupAddress(StackFrame *frame) const = 0;
+ virtual void LookupAddress(StackFrame* frame) const = 0;
// If Windows stack walking information is available covering ADDRESS,
// return a WindowsFrameInfo structure describing it. If the information
// is not available, returns NULL. A NULL return value does not indicate
// an error. The caller takes ownership of any returned WindowsFrameInfo
// object.
- virtual WindowsFrameInfo *
- FindWindowsFrameInfo(const StackFrame *frame) const = 0;
+ virtual WindowsFrameInfo*
+ FindWindowsFrameInfo(const StackFrame* frame) const = 0;
// If CFI stack walking information is available covering ADDRESS,
// return a CFIFrameInfo structure describing it. If the information
// is not available, return NULL. The caller takes ownership of any
// returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const = 0;
+ virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) const = 0;
protected:
- virtual bool ParseCFIRuleSet(const string &rule_set,
- CFIFrameInfo *frame_info) const;
+ virtual bool ParseCFIRuleSet(const string& rule_set,
+ CFIFrameInfo* frame_info) const;
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalk_common.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalk_common.cc
index 704039f3484..90475720550 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalk_common.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalk_common.cc
@@ -69,7 +69,7 @@ static const char kOutputSeparator = '|';
// of registers is completely printed, regardless of the number of calls
// to PrintRegister.
static const int kMaxWidth = 80; // optimize for an 80-column terminal
-static int PrintRegister(const char *name, uint32_t value, int start_col) {
+static int PrintRegister(const char* name, uint32_t value, int start_col) {
char buffer[64];
snprintf(buffer, sizeof(buffer), " %5s = 0x%08x", name, value);
@@ -83,7 +83,7 @@ static int PrintRegister(const char *name, uint32_t value, int start_col) {
}
// PrintRegister64 does the same thing, but for 64-bit registers.
-static int PrintRegister64(const char *name, uint64_t value, int start_col) {
+static int PrintRegister64(const char* name, uint64_t value, int start_col) {
char buffer[64];
snprintf(buffer, sizeof(buffer), " %5s = 0x%016" PRIx64 , name, value);
@@ -98,7 +98,7 @@ static int PrintRegister64(const char *name, uint64_t value, int start_col) {
// StripSeparator takes a string |original| and returns a copy
// of the string with all occurences of |kOutputSeparator| removed.
-static string StripSeparator(const string &original) {
+static string StripSeparator(const string& original) {
string result = original;
string::size_type position = 0;
while ((position = result.find(kOutputSeparator, position)) != string::npos) {
@@ -112,20 +112,20 @@ static string StripSeparator(const string &original) {
}
// PrintStackContents prints the stack contents of the current frame to stdout.
-static void PrintStackContents(const string &indent,
- const StackFrame *frame,
- const StackFrame *prev_frame,
- const string &cpu,
- const MemoryRegion *memory,
+static void PrintStackContents(const string& indent,
+ const StackFrame* frame,
+ const StackFrame* prev_frame,
+ const string& cpu,
+ const MemoryRegion* memory,
const CodeModules* modules,
- SourceLineResolverInterface *resolver) {
+ SourceLineResolverInterface* resolver) {
// Find stack range.
int word_length = 0;
uint64_t stack_begin = 0, stack_end = 0;
if (cpu == "x86") {
word_length = 4;
- const StackFrameX86 *frame_x86 = static_cast<const StackFrameX86*>(frame);
- const StackFrameX86 *prev_frame_x86 =
+ const StackFrameX86* frame_x86 = static_cast<const StackFrameX86*>(frame);
+ const StackFrameX86* prev_frame_x86 =
static_cast<const StackFrameX86*>(prev_frame);
if ((frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP) &&
(prev_frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP)) {
@@ -134,9 +134,9 @@ static void PrintStackContents(const string &indent,
}
} else if (cpu == "amd64") {
word_length = 8;
- const StackFrameAMD64 *frame_amd64 =
+ const StackFrameAMD64* frame_amd64 =
static_cast<const StackFrameAMD64*>(frame);
- const StackFrameAMD64 *prev_frame_amd64 =
+ const StackFrameAMD64* prev_frame_amd64 =
static_cast<const StackFrameAMD64*>(prev_frame);
if ((frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RSP) &&
(prev_frame_amd64->context_validity &
@@ -146,8 +146,8 @@ static void PrintStackContents(const string &indent,
}
} else if (cpu == "arm") {
word_length = 4;
- const StackFrameARM *frame_arm = static_cast<const StackFrameARM*>(frame);
- const StackFrameARM *prev_frame_arm =
+ const StackFrameARM* frame_arm = static_cast<const StackFrameARM*>(frame);
+ const StackFrameARM* prev_frame_arm =
static_cast<const StackFrameARM*>(prev_frame);
if ((frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP) &&
(prev_frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP)) {
@@ -156,9 +156,9 @@ static void PrintStackContents(const string &indent,
}
} else if (cpu == "arm64") {
word_length = 8;
- const StackFrameARM64 *frame_arm64 =
+ const StackFrameARM64* frame_arm64 =
static_cast<const StackFrameARM64*>(frame);
- const StackFrameARM64 *prev_frame_arm64 =
+ const StackFrameARM64* prev_frame_arm64 =
static_cast<const StackFrameARM64*>(prev_frame);
if ((frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_SP) &&
(prev_frame_arm64->context_validity &
@@ -249,8 +249,8 @@ static void PrintStackContents(const string &indent,
//
// If |cpu| is a recognized CPU name, relevant register state for each stack
// frame printed is also output, if available.
-static void PrintStack(const CallStack *stack,
- const string &cpu,
+static void PrintStack(const CallStack* stack,
+ const string& cpu,
bool output_stack_contents,
const MemoryRegion* memory,
const CodeModules* modules,
@@ -260,7 +260,7 @@ static void PrintStack(const CallStack *stack,
printf(" <no frames>\n");
}
for (int frame_index = 0; frame_index < frame_count; ++frame_index) {
- const StackFrame *frame = stack->frames()->at(frame_index);
+ const StackFrame* frame = stack->frames()->at(frame_index);
printf("%2d ", frame_index);
uint64_t instruction_address = frame->ReturnAddress();
@@ -289,7 +289,7 @@ static void PrintStack(const CallStack *stack,
int sequence = 0;
if (cpu == "x86") {
- const StackFrameX86 *frame_x86 =
+ const StackFrameX86* frame_x86 =
reinterpret_cast<const StackFrameX86*>(frame);
if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EIP)
@@ -311,7 +311,7 @@ static void PrintStack(const CallStack *stack,
sequence = PrintRegister("efl", frame_x86->context.eflags, sequence);
}
} else if (cpu == "ppc") {
- const StackFramePPC *frame_ppc =
+ const StackFramePPC* frame_ppc =
reinterpret_cast<const StackFramePPC*>(frame);
if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_SRR0)
@@ -319,7 +319,7 @@ static void PrintStack(const CallStack *stack,
if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_GPR1)
sequence = PrintRegister("r1", frame_ppc->context.gpr[1], sequence);
} else if (cpu == "amd64") {
- const StackFrameAMD64 *frame_amd64 =
+ const StackFrameAMD64* frame_amd64 =
reinterpret_cast<const StackFrameAMD64*>(frame);
if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RAX)
@@ -357,7 +357,7 @@ static void PrintStack(const CallStack *stack,
if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RIP)
sequence = PrintRegister64("rip", frame_amd64->context.rip, sequence);
} else if (cpu == "sparc") {
- const StackFrameSPARC *frame_sparc =
+ const StackFrameSPARC* frame_sparc =
reinterpret_cast<const StackFrameSPARC*>(frame);
if (frame_sparc->context_validity & StackFrameSPARC::CONTEXT_VALID_SP)
@@ -367,7 +367,7 @@ static void PrintStack(const CallStack *stack,
if (frame_sparc->context_validity & StackFrameSPARC::CONTEXT_VALID_PC)
sequence = PrintRegister("pc", frame_sparc->context.pc, sequence);
} else if (cpu == "arm") {
- const StackFrameARM *frame_arm =
+ const StackFrameARM* frame_arm =
reinterpret_cast<const StackFrameARM*>(frame);
// Argument registers (caller-saves), which will likely only be valid
@@ -409,7 +409,7 @@ static void PrintStack(const CallStack *stack,
if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_PC)
sequence = PrintRegister("pc", frame_arm->context.iregs[15], sequence);
} else if (cpu == "arm64") {
- const StackFrameARM64 *frame_arm64 =
+ const StackFrameARM64* frame_arm64 =
reinterpret_cast<const StackFrameARM64*>(frame);
if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X0) {
@@ -621,10 +621,10 @@ static void PrintStack(const CallStack *stack,
// Module, function, source file, and source line may all be empty
// depending on availability. The code offset follows the same rules as
// PrintStack above.
-static void PrintStackMachineReadable(int thread_num, const CallStack *stack) {
+static void PrintStackMachineReadable(int thread_num, const CallStack* stack) {
int frame_count = stack->frames()->size();
for (int frame_index = 0; frame_index < frame_count; ++frame_index) {
- const StackFrame *frame = stack->frames()->at(frame_index);
+ const StackFrame* frame = stack->frames()->at(frame_index);
printf("%d%c%d%c", thread_num, kOutputSeparator, frame_index,
kOutputSeparator);
@@ -676,8 +676,8 @@ static void PrintStackMachineReadable(int thread_num, const CallStack *stack) {
// ContainsModule checks whether a given |module| is in the vector
// |modules_without_symbols|.
static bool ContainsModule(
- const vector<const CodeModule*> *modules,
- const CodeModule *module) {
+ const vector<const CodeModule*>* modules,
+ const CodeModule* module) {
assert(modules);
assert(module);
vector<const CodeModule*>::const_iterator iter;
@@ -694,9 +694,9 @@ static bool ContainsModule(
// |modules_without_symbols| should contain the list of modules that were
// confirmed to be missing their symbols during the stack walk.
static void PrintModule(
- const CodeModule *module,
- const vector<const CodeModule*> *modules_without_symbols,
- const vector<const CodeModule*> *modules_with_corrupt_symbols,
+ const CodeModule* module,
+ const vector<const CodeModule*>* modules_without_symbols,
+ const vector<const CodeModule*>* modules_with_corrupt_symbols,
uint64_t main_address) {
string symbol_issues;
if (ContainsModule(modules_without_symbols, module)) {
@@ -721,9 +721,9 @@ static void PrintModule(
// |modules_without_symbols| should contain the list of modules that were
// confirmed to be missing their symbols during the stack walk.
static void PrintModules(
- const CodeModules *modules,
- const vector<const CodeModule*> *modules_without_symbols,
- const vector<const CodeModule*> *modules_with_corrupt_symbols) {
+ const CodeModules* modules,
+ const vector<const CodeModule*>* modules_without_symbols,
+ const vector<const CodeModule*>* modules_with_corrupt_symbols) {
if (!modules)
return;
@@ -731,7 +731,7 @@ static void PrintModules(
printf("Loaded modules:\n");
uint64_t main_address = 0;
- const CodeModule *main_module = modules->GetMainModule();
+ const CodeModule* main_module = modules->GetMainModule();
if (main_module) {
main_address = main_module->base_address();
}
@@ -740,7 +740,7 @@ static void PrintModules(
for (unsigned int module_sequence = 0;
module_sequence < module_count;
++module_sequence) {
- const CodeModule *module = modules->GetModuleAtSequence(module_sequence);
+ const CodeModule* module = modules->GetModuleAtSequence(module_sequence);
PrintModule(module, modules_without_symbols, modules_with_corrupt_symbols,
main_address);
}
@@ -751,12 +751,12 @@ static void PrintModules(
// text format:
// Module|{Module Filename}|{Version}|{Debug Filename}|{Debug Identifier}|
// {Base Address}|{Max Address}|{Main}
-static void PrintModulesMachineReadable(const CodeModules *modules) {
+static void PrintModulesMachineReadable(const CodeModules* modules) {
if (!modules)
return;
uint64_t main_address = 0;
- const CodeModule *main_module = modules->GetMainModule();
+ const CodeModule* main_module = modules->GetMainModule();
if (main_module) {
main_address = main_module->base_address();
}
@@ -765,7 +765,7 @@ static void PrintModulesMachineReadable(const CodeModules *modules) {
for (unsigned int module_sequence = 0;
module_sequence < module_count;
++module_sequence) {
- const CodeModule *module = modules->GetModuleAtSequence(module_sequence);
+ const CodeModule* module = modules->GetModuleAtSequence(module_sequence);
uint64_t base_address = module->base_address();
printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n",
kOutputSeparator,
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_address_list_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_address_list_unittest.cc
index ab4e9c08807..b09137de3e9 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_address_list_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_address_list_unittest.cc
@@ -94,9 +94,9 @@ class StackwalkerAddressListTest : public testing::Test {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
+ void SetModuleSymbols(MockCodeModule* module, const string& info) {
size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
+ char* buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
EXPECT_CALL(supplier, GetCStringSymbolData(module, NULL, _, _, _))
.WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
SetArgumentPointee<4>(buffer_size),
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.cc
index d5ac6c652e3..f906f20b016 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.cc
@@ -126,7 +126,7 @@ StackFrame* StackwalkerAMD64::GetContextFrame() {
}
StackFrameAMD64* StackwalkerAMD64::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info) {
StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
@@ -217,7 +217,7 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery(
}
StackFrameAMD64* StackwalkerAMD64::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
+ const vector<StackFrame*>& frames) {
StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
uint64_t last_rsp = last_frame->context.rsp;
uint64_t caller_rip_address, caller_rip;
@@ -273,7 +273,7 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack,
return NULL;
}
- const vector<StackFrame*> &frames = *stack->frames();
+ const vector<StackFrame*>& frames = *stack->frames();
StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
scoped_ptr<StackFrameAMD64> new_frame;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.h b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.h
index 8f3dbd52802..5e1af6f13f7 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64.h
@@ -75,7 +75,7 @@ class StackwalkerAMD64 : public Stackwalker {
// Use cfi_frame_info (derived from STACK CFI records) to construct
// the frame that called frames.back(). The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameAMD64* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
+ StackFrameAMD64* GetCallerByCFIFrameInfo(const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info);
// Assumes a traditional frame layout where the frame pointer has not been
@@ -88,7 +88,7 @@ class StackwalkerAMD64 : public Stackwalker {
// Scan the stack for plausible return addresses. The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameAMD64* GetCallerByStackScan(const vector<StackFrame*> &frames);
+ StackFrameAMD64* GetCallerByStackScan(const vector<StackFrame*>& frames);
// Stores the CPU context corresponding to the innermost stack frame to
// be returned by GetContextFrame.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64_unittest.cc
index efcd812a359..a77015a6c30 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_amd64_unittest.cc
@@ -104,7 +104,7 @@ class StackwalkerAMD64Fixture {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &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, _, _, _))
@@ -125,7 +125,7 @@ class StackwalkerAMD64Fixture {
void BrandContext(MDRawContextAMD64 *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);
+ reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
}
SystemInfo system_info;
@@ -138,7 +138,7 @@ class StackwalkerAMD64Fixture {
MockSymbolSupplier supplier;
BasicSourceLineResolver resolver;
CallStack call_stack;
- const vector<StackFrame *> *frames;
+ const vector<StackFrame*>* frames;
};
class GetContextFrame: public StackwalkerAMD64Fixture, public Test { };
@@ -166,7 +166,7 @@ TEST_F(SanityCheck, NoResolver) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64*>(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)));
@@ -192,7 +192,7 @@ TEST_F(GetContextFrame, Simple) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64*>(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)));
@@ -216,7 +216,7 @@ TEST_F(GetContextFrame, NoStackMemory) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
+ StackFrameAMD64 *frame = static_cast<StackFrameAMD64*>(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)));
@@ -279,12 +279,12 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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));
+ 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 |
@@ -294,7 +294,7 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
- StackFrameAMD64 *frame2 = static_cast<StackFrameAMD64 *>(frames->at(2));
+ StackFrameAMD64 *frame2 = static_cast<StackFrameAMD64*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
StackFrameAMD64::CONTEXT_VALID_RSP),
@@ -352,13 +352,13 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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("platypus", frame0->function_name);
EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
+ 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 |
@@ -464,7 +464,7 @@ TEST_F(GetCallerFrame, GetCallerByFramePointerRecovery) {
ASSERT_EQ(3U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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);
@@ -475,7 +475,7 @@ TEST_F(GetCallerFrame, GetCallerByFramePointerRecovery) {
}
{ // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(1));
+ 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 |
@@ -489,7 +489,7 @@ TEST_F(GetCallerFrame, GetCallerByFramePointerRecovery) {
}
{ // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(2));
+ 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 |
@@ -540,12 +540,12 @@ TEST_F(GetCallerFrame, FramePointerNotAligned) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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));
+ 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),
@@ -590,12 +590,12 @@ TEST_F(GetCallerFrame, NonCanonicalInstructionPointerFromFramePointer) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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));
+ 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),
@@ -660,7 +660,7 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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)));
@@ -718,14 +718,14 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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(frame0_rbp.Value(), frame0->context.rbp);
EXPECT_EQ("sasquatch", frame0->function_name);
EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
+ StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
StackFrameAMD64::CONTEXT_VALID_RSP |
@@ -799,13 +799,13 @@ struct CFIFixture: public StackwalkerAMD64Fixture {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
+ 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("enchiridion", frame0->function_name);
EXPECT_EQ(0x00007400c0004000ULL, frame0->function_base);
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
+ StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
StackFrameAMD64::CONTEXT_VALID_RSP |
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.cc
index 1313416f4d0..f6f2c9bf4d7 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.cc
@@ -78,7 +78,7 @@ StackFrame* StackwalkerARM::GetContextFrame() {
}
StackFrameARM* StackwalkerARM::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info) {
StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
@@ -162,7 +162,7 @@ StackFrameARM* StackwalkerARM::GetCallerByCFIFrameInfo(
}
StackFrameARM* StackwalkerARM::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
+ const vector<StackFrame*>& frames) {
StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP];
uint32_t caller_sp, caller_pc;
@@ -193,7 +193,7 @@ StackFrameARM* StackwalkerARM::GetCallerByStackScan(
}
StackFrameARM* StackwalkerARM::GetCallerByFramePointer(
- const vector<StackFrame*> &frames) {
+ const vector<StackFrame*>& frames) {
StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
if (!(last_frame->context_validity &
@@ -245,7 +245,7 @@ StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack,
return NULL;
}
- const vector<StackFrame*> &frames = *stack->frames();
+ const vector<StackFrame*>& frames = *stack->frames();
StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
scoped_ptr<StackFrameARM> frame;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.h b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.h
index 9081a40cd0a..72ddddcc471 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm.h
@@ -75,16 +75,16 @@ class StackwalkerARM : public Stackwalker {
// Use cfi_frame_info (derived from STACK CFI records) to construct
// the frame that called frames.back(). The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameARM* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
+ StackFrameARM* GetCallerByCFIFrameInfo(const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info);
// Use the frame pointer. The caller takes ownership of the returned frame.
// Return NULL on failure.
- StackFrameARM* GetCallerByFramePointer(const vector<StackFrame*> &frames);
+ StackFrameARM* GetCallerByFramePointer(const vector<StackFrame*>& frames);
// Scan the stack for plausible return addresses. The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameARM* GetCallerByStackScan(const vector<StackFrame*> &frames);
+ StackFrameARM* GetCallerByStackScan(const vector<StackFrame*>& frames);
// Stores the CPU context corresponding to the youngest stack frame, to
// be returned by GetContextFrame.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.cc
index 5bfd2636e97..9acf8188efb 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.cc
@@ -99,7 +99,7 @@ StackFrame* StackwalkerARM64::GetContextFrame() {
}
StackFrameARM64* StackwalkerARM64::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info) {
StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
@@ -175,7 +175,7 @@ StackFrameARM64* StackwalkerARM64::GetCallerByCFIFrameInfo(
}
StackFrameARM64* StackwalkerARM64::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
+ const vector<StackFrame*>& frames) {
StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
uint64_t last_sp = last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP];
uint64_t caller_sp, caller_pc;
@@ -206,7 +206,7 @@ StackFrameARM64* StackwalkerARM64::GetCallerByStackScan(
}
StackFrameARM64* StackwalkerARM64::GetCallerByFramePointer(
- const vector<StackFrame*> &frames) {
+ 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);
@@ -294,7 +294,7 @@ StackFrame* StackwalkerARM64::GetCallerFrame(const CallStack* stack,
return NULL;
}
- const vector<StackFrame*> &frames = *stack->frames();
+ const vector<StackFrame*>& frames = *stack->frames();
StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
scoped_ptr<StackFrameARM64> frame;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.h b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.h
index 39735c67c80..4c7da3fbd7c 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64.h
@@ -79,16 +79,16 @@ class StackwalkerARM64 : public Stackwalker {
// Use cfi_frame_info (derived from STACK CFI records) to construct
// the frame that called frames.back(). The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameARM64* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
+ StackFrameARM64* GetCallerByCFIFrameInfo(const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info);
// Use the frame pointer. The caller takes ownership of the returned frame.
// Return NULL on failure.
- StackFrameARM64* GetCallerByFramePointer(const vector<StackFrame*> &frames);
+ StackFrameARM64* GetCallerByFramePointer(const vector<StackFrame*>& frames);
// Scan the stack for plausible return addresses. The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameARM64* GetCallerByStackScan(const vector<StackFrame*> &frames);
+ 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.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64_unittest.cc
index d86fa127795..6553e0cd9bd 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm64_unittest.cc
@@ -105,7 +105,7 @@ class StackwalkerARM64Fixture {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &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, _, _, _))
@@ -126,7 +126,7 @@ class StackwalkerARM64Fixture {
void BrandContext(MDRawContextARM64 *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);
+ reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
}
SystemInfo system_info;
@@ -139,7 +139,7 @@ class StackwalkerARM64Fixture {
MockSymbolSupplier supplier;
BasicSourceLineResolver resolver;
CallStack call_stack;
- const vector<StackFrame *> *frames;
+ const vector<StackFrame*>* frames;
};
class SanityCheck: public StackwalkerARM64Fixture, public Test { };
@@ -159,7 +159,7 @@ TEST_F(SanityCheck, NoResolver) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM64 *frame = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame = static_cast<StackFrameARM64*>(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)));
@@ -181,7 +181,7 @@ TEST_F(GetContextFrame, NoStackMemory) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM64 *frame = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame = static_cast<StackFrameARM64*>(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)));
@@ -237,13 +237,13 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
+ StackFrameARM64 *frame1 = static_cast<StackFrameARM64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_SP),
@@ -251,7 +251,7 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
- StackFrameARM64 *frame2 = static_cast<StackFrameARM64 *>(frames->at(2));
+ StackFrameARM64 *frame2 = static_cast<StackFrameARM64*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_SP),
@@ -307,7 +307,7 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
frame0->context_validity);
@@ -315,7 +315,7 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
EXPECT_EQ("monotreme", frame0->function_name);
EXPECT_EQ(0x40000100ULL, frame0->function_base);
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
+ StackFrameARM64 *frame1 = static_cast<StackFrameARM64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_SP),
@@ -376,13 +376,13 @@ TEST_F(GetCallerFrame, ScanFirstFrame) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
+ StackFrameARM64 *frame1 = static_cast<StackFrameARM64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_SP),
@@ -440,7 +440,7 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
frame0->context_validity);
@@ -503,13 +503,13 @@ TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
+ StackFrameARM64 *frame1 = static_cast<StackFrameARM64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_LR |
@@ -522,7 +522,7 @@ TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
EXPECT_EQ(frame2_fp.Value(),
frame1->context.iregs[MD_CONTEXT_ARM64_REG_FP]);
- StackFrameARM64 *frame2 = static_cast<StackFrameARM64 *>(frames->at(2));
+ StackFrameARM64 *frame2 = static_cast<StackFrameARM64*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust);
ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
StackFrameARM64::CONTEXT_VALID_LR |
@@ -642,13 +642,13 @@ struct CFIFixture: public StackwalkerARM64Fixture {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
+ StackFrameARM64 *frame0 = static_cast<StackFrameARM64*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(context_frame_validity, frame0->context_validity);
EXPECT_EQ("enchiridion", frame0->function_name);
EXPECT_EQ(0x0000000040004000UL, frame0->function_base);
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
+ StackFrameARM64 *frame1 = static_cast<StackFrameARM64*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ(expected_validity, frame1->context_validity);
if (expected_validity & StackFrameARM64::CONTEXT_VALID_X1)
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm_unittest.cc
index 256f7648c4c..046081fa248 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_arm_unittest.cc
@@ -106,7 +106,7 @@ class StackwalkerARMFixture {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &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, _, _, _))
@@ -127,7 +127,7 @@ class StackwalkerARMFixture {
void BrandContext(MDRawContextARM *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);
+ reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
}
SystemInfo system_info;
@@ -140,7 +140,7 @@ class StackwalkerARMFixture {
MockSymbolSupplier supplier;
BasicSourceLineResolver resolver;
CallStack call_stack;
- const vector<StackFrame *> *frames;
+ const vector<StackFrame*>* frames;
};
class SanityCheck: public StackwalkerARMFixture, public Test { };
@@ -161,7 +161,7 @@ TEST_F(SanityCheck, NoResolver) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame = static_cast<StackFrameARM*>(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)));
@@ -184,7 +184,7 @@ TEST_F(GetContextFrame, Simple) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame = static_cast<StackFrameARM*>(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)));
@@ -204,7 +204,7 @@ TEST_F(GetContextFrame, NoStackMemory) {
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame = static_cast<StackFrameARM*>(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)));
@@ -260,12 +260,12 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_SP),
@@ -273,7 +273,7 @@ TEST_F(GetCallerFrame, ScanWithoutSymbols) {
EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
+ StackFrameARM *frame2 = static_cast<StackFrameARM*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_SP),
@@ -329,14 +329,14 @@ TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::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(0x40000100U, frame0->function_base);
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_SP),
@@ -397,12 +397,12 @@ TEST_F(GetCallerFrame, ScanFirstFrame) {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_SP),
@@ -460,7 +460,7 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
frames = call_stack.frames();
ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
@@ -565,13 +565,13 @@ struct CFIFixture: public StackwalkerARMFixture {
frames = call_stack.frames();
ASSERT_EQ(2U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(context_frame_validity, frame0->context_validity);
EXPECT_EQ("enchiridion", frame0->function_name);
EXPECT_EQ(0x40004000U, frame0->function_base);
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ(expected_validity, frame1->context_validity);
if (expected_validity & StackFrameARM::CONTEXT_VALID_R1)
@@ -848,12 +848,12 @@ TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_LR |
@@ -866,7 +866,7 @@ TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
EXPECT_EQ(frame2_fp.Value(),
frame1->context.iregs[MD_CONTEXT_ARM_REG_IOS_FP]);
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
+ StackFrameARM *frame2 = static_cast<StackFrameARM*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_LR |
@@ -944,12 +944,12 @@ TEST_F(GetFramesByFramePointer, FramePointerAndCFI) {
frames = call_stack.frames();
ASSERT_EQ(3U, frames->size());
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
+ StackFrameARM *frame0 = static_cast<StackFrameARM*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
+ StackFrameARM *frame1 = static_cast<StackFrameARM*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_LR |
@@ -965,7 +965,7 @@ TEST_F(GetFramesByFramePointer, FramePointerAndCFI) {
EXPECT_EQ(0x40004000U, frame1->function_base);
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
+ StackFrameARM *frame2 = static_cast<StackFrameARM*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
StackFrameARM::CONTEXT_VALID_LR |
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_selftest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_selftest.cc
index f692d4c4c0d..dcb2df007ed 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_selftest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_selftest.cc
@@ -420,7 +420,7 @@ int main(int argc, char** argv) {
// Not i386 or ppc or sparc? We can only test stacks we know how to walk.
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
BPLOG_INIT(&argc, &argv);
// "make check" interprets an exit status of 77 to mean that the test is
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_unittest_utils.h b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_unittest_utils.h
index 3a92a5ea7a7..2905ea06e12 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_unittest_utils.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_unittest_utils.h
@@ -57,7 +57,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion {
// Set this region's address and contents. If we have placed an
// instance of this class in a test fixture class, individual tests
// can use this to provide the region's contents.
- void Init(uint64_t base_address, const string &contents) {
+ void Init(uint64_t base_address, const string& contents) {
base_address_ = base_address;
contents_ = contents;
}
@@ -65,16 +65,16 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion {
uint64_t GetBase() const { return base_address_; }
uint32_t GetSize() const { return contents_.size(); }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
return GetMemoryLittleEndian(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
return GetMemoryLittleEndian(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
return GetMemoryLittleEndian(address, value);
}
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
+ bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
return GetMemoryLittleEndian(address, value);
}
void Print() const {
@@ -85,7 +85,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion {
// Fetch a little-endian value from ADDRESS in contents_ whose size
// is BYTES, and store it in *VALUE. Return true on success.
template<typename ValueType>
- bool GetMemoryLittleEndian(uint64_t address, ValueType *value) const {
+ bool GetMemoryLittleEndian(uint64_t address, ValueType* value) const {
if (address < base_address_ ||
address - base_address_ + sizeof(ValueType) > contents_.size())
return false;
@@ -105,7 +105,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion {
class MockCodeModule: public google_breakpad::CodeModule {
public:
MockCodeModule(uint64_t base_address, uint64_t size,
- const string &code_file, const string &version)
+ const string& code_file, const string& version)
: base_address_(base_address), size_(size), code_file_(code_file) { }
uint64_t base_address() const { return base_address_; }
@@ -115,7 +115,7 @@ 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_; }
- google_breakpad::CodeModule *Copy() const {
+ google_breakpad::CodeModule* Copy() const {
abort(); // Tests won't use this.
}
virtual bool is_unloaded() const { return false; }
@@ -134,16 +134,16 @@ class MockCodeModules: public google_breakpad::CodeModules {
typedef google_breakpad::CodeModule CodeModule;
typedef google_breakpad::CodeModules CodeModules;
- void Add(const MockCodeModule *module) {
+ void Add(const MockCodeModule* module) {
modules_.push_back(module);
}
unsigned int module_count() const { return modules_.size(); }
- const CodeModule *GetModuleForAddress(uint64_t address) const {
+ const CodeModule* GetModuleForAddress(uint64_t address) const {
for (ModuleVector::const_iterator i = modules_.begin();
i != modules_.end(); i++) {
- const MockCodeModule *module = *i;
+ const MockCodeModule* module = *i;
if (module->base_address() <= address &&
address - module->base_address() < module->size())
return module;
@@ -151,17 +151,17 @@ class MockCodeModules: public google_breakpad::CodeModules {
return NULL;
};
- const CodeModule *GetMainModule() const { return modules_[0]; }
+ const CodeModule* GetMainModule() const { return modules_[0]; }
- const CodeModule *GetModuleAtSequence(unsigned int sequence) const {
+ const CodeModule* GetModuleAtSequence(unsigned int sequence) const {
return modules_.at(sequence);
}
- const CodeModule *GetModuleAtIndex(unsigned int index) const {
+ const CodeModule* GetModuleAtIndex(unsigned int index) const {
return modules_.at(index);
}
- 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 {
@@ -169,7 +169,7 @@ class MockCodeModules: public google_breakpad::CodeModules {
}
private:
- typedef std::vector<const MockCodeModule *> ModuleVector;
+ typedef std::vector<const MockCodeModule*> ModuleVector;
ModuleVector modules_;
};
@@ -177,26 +177,26 @@ class MockSymbolSupplier: public google_breakpad::SymbolSupplier {
public:
typedef google_breakpad::CodeModule CodeModule;
typedef google_breakpad::SystemInfo SystemInfo;
- MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file));
- MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data));
- MOCK_METHOD5(GetCStringSymbolData, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size));
- MOCK_METHOD1(FreeSymbolData, void(const CodeModule *module));
+ MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file));
+ MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data));
+ MOCK_METHOD5(GetCStringSymbolData, SymbolResult(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size));
+ MOCK_METHOD1(FreeSymbolData, void(const CodeModule* module));
// Copies the passed string contents into a newly allocated buffer.
// The newly allocated buffer will be freed during destruction.
- char* CopySymbolDataAndOwnTheCopy(const string &info,
- size_t *symbol_data_size) {
+ char* CopySymbolDataAndOwnTheCopy(const string& info,
+ size_t* symbol_data_size) {
*symbol_data_size = info.size() + 1;
- char *symbol_data = new char[*symbol_data_size];
+ char* symbol_data = new char[*symbol_data_size];
memcpy(symbol_data, info.c_str(), info.size());
symbol_data[info.size()] = '\0';
symbol_data_to_free_.push_back(symbol_data);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.cc
index ed2b383d4fb..b11e061d4ca 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.cc
@@ -136,7 +136,7 @@ StackFrame* StackwalkerX86::GetContextFrame() {
}
StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
WindowsFrameInfo* last_frame_info,
bool stack_scan_allowed) {
StackFrame::FrameTrust trust = StackFrame::FRAME_TRUST_NONE;
@@ -514,7 +514,7 @@ StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo(
}
StackFrameX86* StackwalkerX86::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info) {
StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
last_frame->cfi_frame_info = cfi_frame_info;
@@ -539,7 +539,7 @@ StackFrameX86* StackwalkerX86::GetCallerByCFIFrameInfo(
}
StackFrameX86* StackwalkerX86::GetCallerByEBPAtBase(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
bool stack_scan_allowed) {
StackFrame::FrameTrust trust;
StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
@@ -632,7 +632,7 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack* stack,
return NULL;
}
- const vector<StackFrame*> &frames = *stack->frames();
+ const vector<StackFrame*>& frames = *stack->frames();
StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
scoped_ptr<StackFrameX86> new_frame;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.h b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.h
index 0659a13bf4c..1783fda32bc 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86.h
@@ -81,14 +81,14 @@ class StackwalkerX86 : public Stackwalker {
// to construct the frame that called frames.back(). The caller
// takes ownership of the returned frame. Return NULL on failure.
StackFrameX86* GetCallerByWindowsFrameInfo(
- const vector<StackFrame*> &frames,
+ const vector<StackFrame*>& frames,
WindowsFrameInfo* windows_frame_info,
bool stack_scan_allowed);
// Use cfi_frame_info (derived from STACK CFI records) to construct
// the frame that called frames.back(). The caller takes ownership
// of the returned frame. Return NULL on failure.
- StackFrameX86* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
+ StackFrameX86* GetCallerByCFIFrameInfo(const vector<StackFrame*>& frames,
CFIFrameInfo* cfi_frame_info);
// Assuming a traditional frame layout --- where the caller's %ebp
@@ -96,7 +96,7 @@ class StackwalkerX86 : public Stackwalker {
// %ebp points to the saved %ebp --- construct the frame that called
// frames.back(). The caller takes ownership of the returned frame.
// Return NULL on failure.
- StackFrameX86* GetCallerByEBPAtBase(const vector<StackFrame*> &frames,
+ StackFrameX86* GetCallerByEBPAtBase(const vector<StackFrame*>& frames,
bool stack_scan_allowed);
// Stores the CPU context corresponding to the innermost stack frame to
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86_unittest.cc
index 359f1c863b6..b6f14a14515 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/stackwalker_x86_unittest.cc
@@ -113,7 +113,7 @@ class StackwalkerX86Fixture {
// Set the Breakpad symbol information that supplier should return for
// MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &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, _, _, _))
@@ -134,7 +134,7 @@ class StackwalkerX86Fixture {
void BrandContext(MDRawContextX86 *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);
+ reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
}
SystemInfo system_info;
@@ -151,7 +151,7 @@ class StackwalkerX86Fixture {
MockSymbolSupplier supplier;
BasicSourceLineResolver resolver;
CallStack call_stack;
- const vector<StackFrame *> *frames;
+ const vector<StackFrame*>* frames;
};
class SanityCheck: public StackwalkerX86Fixture, public Test { };
@@ -175,7 +175,7 @@ TEST_F(SanityCheck, NoResolver) {
ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(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)));
@@ -201,7 +201,7 @@ TEST_F(GetContextFrame, Simple) {
ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(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)));
@@ -224,7 +224,7 @@ TEST_F(GetContextFrame, NoStackMemory) {
ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(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)));
@@ -269,7 +269,7 @@ TEST_F(GetCallerFrame, Traditional) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
EXPECT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000c7a5U, frame0->instruction);
@@ -279,7 +279,7 @@ TEST_F(GetCallerFrame, Traditional) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -333,7 +333,7 @@ TEST_F(GetCallerFrame, TraditionalScan) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000f49dU, frame0->instruction);
@@ -344,7 +344,7 @@ TEST_F(GetCallerFrame, TraditionalScan) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -399,7 +399,7 @@ TEST_F(GetCallerFrame, TraditionalScanLongWay) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000f49dU, frame0->instruction);
@@ -410,7 +410,7 @@ TEST_F(GetCallerFrame, TraditionalScanLongWay) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -465,7 +465,7 @@ TEST_F(GetCallerFrame, ScanningNotAllowed) {
ASSERT_EQ(1U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000f49dU, frame0->instruction);
@@ -524,7 +524,7 @@ TEST_F(GetCallerFrame, WindowsFrameData) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000aa85U, frame0->instruction);
@@ -535,7 +535,7 @@ TEST_F(GetCallerFrame, WindowsFrameData) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -605,7 +605,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataAligned) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000aa85U, frame0->instruction);
@@ -616,7 +616,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataAligned) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -693,7 +693,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataParameterSize) {
ASSERT_EQ(3U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x40001004U, frame0->instruction);
@@ -714,7 +714,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataParameterSize) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -737,7 +737,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataParameterSize) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
+ StackFrameX86 *frame2 = static_cast<StackFrameX86*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -793,7 +793,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataScan) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x40000c9cU, frame0->instruction);
@@ -804,7 +804,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataScan) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
// I'd argue that CONTEXT_VALID_EBP shouldn't be here, since the walker
// does not actually fetch the EBP after a scan (forcing the next frame
@@ -882,7 +882,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataBadEIPScan) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x40000700U, frame0->instruction);
@@ -893,7 +893,7 @@ TEST_F(GetCallerFrame, WindowsFrameDataBadEIPScan) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI_SCAN, frame1->trust);
// I'd argue that CONTEXT_VALID_EBP shouldn't be here, since the
// walker does not actually fetch the EBP after a scan (forcing the
@@ -955,7 +955,7 @@ TEST_F(GetCallerFrame, WindowsFPOUnchangedEBP) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x4000e8b8U, frame0->instruction);
@@ -976,7 +976,7 @@ TEST_F(GetCallerFrame, WindowsFPOUnchangedEBP) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -1039,7 +1039,7 @@ TEST_F(GetCallerFrame, WindowsFPOUsedEBP) {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x40009ab8U, frame0->instruction);
@@ -1060,7 +1060,7 @@ TEST_F(GetCallerFrame, WindowsFPOUsedEBP) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -1170,8 +1170,8 @@ TEST_F(GetCallerFrame, WindowsFPOReferencesEBX) {
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;
+ 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());
@@ -1180,31 +1180,31 @@ TEST_F(GetCallerFrame, WindowsFPOReferencesEBX) {
ASSERT_EQ(5U, frames->size());
{
- const StackFrameX86 &frame = *static_cast<StackFrameX86 *>(frames->at(0));
+ 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));
+ 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));
+ 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));
+ 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));
+ 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);
@@ -1318,7 +1318,7 @@ TEST_F(GetCallerFrame, WindowsFPOSystemCall) {
ASSERT_EQ(4U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x771ef8c1U, frame0->instruction);
@@ -1338,7 +1338,7 @@ TEST_F(GetCallerFrame, WindowsFPOSystemCall) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
| StackFrameX86::CONTEXT_VALID_ESP
@@ -1532,7 +1532,7 @@ TEST_F(GetCallerFrame, ReturnAddressIsNotInKnownModule) {
ASSERT_EQ(3U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(0x77c181cdU, frame0->instruction);
@@ -1554,7 +1554,7 @@ TEST_F(GetCallerFrame, ReturnAddressIsNotInKnownModule) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI_SCAN, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -1578,7 +1578,7 @@ TEST_F(GetCallerFrame, ReturnAddressIsNotInKnownModule) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
+ StackFrameX86 *frame2 = static_cast<StackFrameX86*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -1610,7 +1610,7 @@ TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
MockCodeModule chrome_dll(0x59630000, 0x19e3000, "chrome.dll", "version1");
SetModuleSymbols(&chrome_dll, // chrome.dll
"FUNC 56422 50c 8 base::MessageLoop::RunTask"
- "(base::PendingTask const &)\n"
+ "(base::PendingTask const&)\n"
"56422 e 458 4589\n"
"STACK WIN 4 56422 50c 11 0 8 c ac 0 1 $T1 .raSearch = $T0 "
"$T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + = "
@@ -1627,7 +1627,7 @@ TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
"$T1 4 - 64 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + "
"= $20 $T0 56 - ^ = $23 $T0 60 - ^ = $24 $T0 64 - ^ =\n"
"FUNC 55bf0 49 4 base::MessagePumpWin::Run(base::"
- "MessagePump::Delegate *)\n"
+ "MessagePump::Delegate*)\n"
"55bf0 49 48 4724\n"
"STACK WIN 4 55bf0 49 c 0 4 0 10 0 1 $T0 $ebp = $eip $T0 4 "
"+ ^ = $ebp $T0 ^ = $esp $T0 8 + =\n"
@@ -1735,7 +1735,7 @@ TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
ASSERT_EQ(3U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame->context_validity);
EXPECT_EQ("base::MessagePumpForIO::DoRunLoop()", frame->function_name);
@@ -1756,13 +1756,13 @@ TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
StackFrameX86::CONTEXT_VALID_EBP),
frame->context_validity);
- EXPECT_EQ("base::MessagePumpWin::Run(base::MessagePump::Delegate *)",
+ EXPECT_EQ("base::MessagePumpWin::Run(base::MessagePump::Delegate*)",
frame->function_name);
EXPECT_EQ(1500011566U, frame->instruction + 1);
EXPECT_EQ(1500011566U, frame->context.eip);
@@ -1779,7 +1779,7 @@ TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(2));
+ StackFrameX86 *frame = static_cast<StackFrameX86*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -1984,7 +1984,7 @@ void GetCallerFrame::IPAddressIsNotInKnownModuleTestImpl(
ASSERT_EQ(4U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ(raw_context.eip, frame0->context.eip);
@@ -1996,7 +1996,7 @@ void GetCallerFrame::IPAddressIsNotInKnownModuleTestImpl(
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -2016,7 +2016,7 @@ void GetCallerFrame::IPAddressIsNotInKnownModuleTestImpl(
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
+ StackFrameX86 *frame2 = static_cast<StackFrameX86*>(frames->at(2));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -2036,7 +2036,7 @@ void GetCallerFrame::IPAddressIsNotInKnownModuleTestImpl(
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame3 = static_cast<StackFrameX86 *>(frames->at(3));
+ StackFrameX86 *frame3 = static_cast<StackFrameX86*>(frames->at(3));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame3->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
@@ -2126,7 +2126,7 @@ struct CFIFixture: public StackwalkerX86Fixture {
ASSERT_EQ(2U, frames->size());
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
+ StackFrameX86 *frame0 = static_cast<StackFrameX86*>(frames->at(0));
EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
EXPECT_EQ("enchiridion", frame0->function_name);
@@ -2138,7 +2138,7 @@ struct CFIFixture: public StackwalkerX86Fixture {
}
{ // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
+ StackFrameX86 *frame1 = static_cast<StackFrameX86*>(frames->at(1));
EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
StackFrameX86::CONTEXT_VALID_ESP |
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map-inl.h
index 67e07976e08..9d2c1defbb1 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map-inl.h
@@ -44,8 +44,8 @@ namespace google_breakpad {
template<typename AddressType, typename EntryType>
bool StaticAddressMap<AddressType, EntryType>::Retrieve(
- const AddressType &address,
- const EntryType *&entry, AddressType *entry_address) const {
+ const AddressType& address,
+ const EntryType*& entry, AddressType* entry_address) const {
// upper_bound gives the first element whose key is greater than address,
// but we want the first element whose key is less than or equal to address.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map.h b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map.h
index 6bafc667501..9d1a467b021 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map.h
@@ -52,15 +52,15 @@ template<typename AddressType, typename EntryType>
class StaticAddressMap {
public:
StaticAddressMap(): map_() { }
- explicit StaticAddressMap(const char *map_data): map_(map_data) { }
+ explicit StaticAddressMap(const char* map_data): map_(map_data) { }
// Locates the entry stored at the highest address less than or equal to
// the address argument. If there is no such range, returns false. The
// entry is returned in entry, which is a required argument. If
// entry_address is not NULL, it will be set to the address that the entry
// was stored at.
- bool Retrieve(const AddressType &address,
- const EntryType *&entry, AddressType *entry_address) const;
+ bool Retrieve(const AddressType& address,
+ const EntryType*& entry, AddressType* entry_address) const;
private:
friend class ModuleComparer;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map_unittest.cc
index 12c735cff01..9f1215d6ae8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_address_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_address_map_unittest.cc
@@ -95,7 +95,7 @@ class TestStaticAddressMap : public ::testing::Test {
int address_test;
string entry;
string entry_test;
- const char *entry_cstring = NULL;
+ const char* entry_cstring = NULL;
bool found;
bool found_test;
@@ -143,11 +143,11 @@ class TestStaticAddressMap : public ::testing::Test {
// Test data sets:
static const int kNumberTestCases = 4;
static const int testsize[];
- int *testdata[kNumberTestCases];
+ int* testdata[kNumberTestCases];
AddrMap addr_map[kNumberTestCases];
TestMap test_map[kNumberTestCases];
- char *map_data[kNumberTestCases];
+ char* map_data[kNumberTestCases];
google_breakpad::AddressMapSerializer<int, string> serializer;
};
@@ -229,7 +229,7 @@ TEST_F(TestStaticAddressMap, Test1000RandomElementsMap) {
}
}
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map-inl.h
index 777c7621840..87ea6c7f57c 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map-inl.h
@@ -47,7 +47,7 @@ StaticContainedRangeMap<AddressType, EntryType>::StaticContainedRangeMap(
const char *base)
: base_(*(reinterpret_cast<const AddressType*>(base))),
entry_size_(*(reinterpret_cast<const uint32_t*>(base + sizeof(base_)))),
- entry_ptr_(reinterpret_cast<const EntryType *>(
+ entry_ptr_(reinterpret_cast<const EntryType*>(
base + sizeof(base_) + sizeof(entry_size_))),
map_(base + sizeof(base_) + sizeof(entry_size_) + entry_size_) {
if (entry_size_ == 0)
@@ -57,7 +57,7 @@ StaticContainedRangeMap<AddressType, EntryType>::StaticContainedRangeMap(
template<typename AddressType, typename EntryType>
bool StaticContainedRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, const EntryType *&entry) const {
+ const AddressType& address, const EntryType*& entry) const {
// Get an iterator to the child range whose high address is equal to or
// greater than the supplied address. If the supplied address is higher
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map.h b/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map.h
index 6a9b8b7b6dc..14fa5e95e9e 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_contained_range_map.h
@@ -57,7 +57,7 @@ class StaticContainedRangeMap {
// child ranges, and not the entry contained by |this|. This is necessary
// to support a sparsely-populated root range. If no descendant range
// encompasses the address, returns false.
- bool RetrieveRange(const AddressType &address, const EntryType *&entry) const;
+ bool RetrieveRange(const AddressType& address, const EntryType*& entry) const;
private:
friend class ModuleComparer;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/static_map-inl.h
index e6aac6aba4b..75a8a335a49 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_map-inl.h
@@ -59,7 +59,7 @@ StaticMap<Key, Value, Compare>::StaticMap(const char* raw_data)
// find(), lower_bound() and upper_bound() implement binary search algorithm.
template<typename Key, typename Value, typename Compare>
StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::find(const Key &key) const {
+StaticMap<Key, Value, Compare>::find(const Key& key) const {
int begin = 0;
int end = num_nodes_;
int middle;
@@ -80,7 +80,7 @@ StaticMap<Key, Value, Compare>::find(const Key &key) const {
template<typename Key, typename Value, typename Compare>
StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::lower_bound(const Key &key) const {
+StaticMap<Key, Value, Compare>::lower_bound(const Key& key) const {
int begin = 0;
int end = num_nodes_;
int middle;
@@ -101,7 +101,7 @@ StaticMap<Key, Value, Compare>::lower_bound(const Key &key) const {
template<typename Key, typename Value, typename Compare>
StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::upper_bound(const Key &key) const {
+StaticMap<Key, Value, Compare>::upper_bound(const Key& key) const {
int begin = 0;
int end = num_nodes_;
int middle;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_map.h b/chromium/third_party/breakpad/breakpad/src/processor/static_map.h
index 9723ab2a846..e7d8c96004f 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_map.h
@@ -72,7 +72,7 @@ namespace google_breakpad {
template<typename Key>
class DefaultCompare {
public:
- int operator()(const Key &k1, const Key &k2) const {
+ int operator()(const Key& k1, const Key& k2) const {
if (k1 < k2) return -1;
if (k1 == k2) return 0;
return 1;
@@ -104,15 +104,15 @@ class StaticMap {
}
// Lookup operations.
- iterator find(const Key &k) const;
+ iterator find(const Key& k) const;
// lower_bound(k) searches in a sorted range for the first element that has a
// key not less than the argument k.
- iterator lower_bound(const Key &k) const;
+ iterator lower_bound(const Key& k) const;
// upper_bound(k) searches in a sorted range for the first element that has a
// key greater than the argument k.
- iterator upper_bound(const Key &k) const;
+ iterator upper_bound(const Key& k) const;
// Checks if the underlying memory data conforms to the predefined pattern:
// first check the number of nodes is non-negative,
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator-inl.h
index 7a7db5ad93b..84745842c6e 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator-inl.h
@@ -43,7 +43,7 @@ namespace google_breakpad {
template<typename Key, typename Value, typename Compare>
StaticMapIterator<Key, Value, Compare>::StaticMapIterator(const char* base,
- const int &index):
+ const int& index):
index_(index), base_(base) {
// See static_map.h for documentation on
// bytes format of serialized StaticMap data.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator.h b/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator.h
index 1af8fff4543..c49a8b71be1 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_map_iterator.h
@@ -87,7 +87,7 @@ class StaticMapIterator {
friend class StaticMap<Key, Value, Compare>;
// Only StaticMap can call this constructor.
- explicit StaticMapIterator(const char* base, const int32_t &index);
+ explicit StaticMapIterator(const char* base, const int32_t& index);
// Index of node that the iterator is pointing to.
int32_t index_;
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/static_map_unittest.cc
index 393d43d5c53..d17153d9677 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_map_unittest.cc
@@ -46,7 +46,7 @@ typedef std::map< KeyType, ValueType > StdMap;
template<typename Key, typename Value>
class SimpleMapSerializer {
public:
- static char* Serialize(const std::map<Key, Value> &stdmap,
+ static char* Serialize(const std::map<Key, Value>& stdmap,
unsigned int* size = NULL) {
unsigned int size_per_node =
sizeof(uint32_t) + sizeof(Key) + sizeof(Value);
@@ -237,19 +237,19 @@ class TestValidMap : public ::testing::Test {
}
}
- void FindTester(int test_case, const KeyType &key) {
+ void FindTester(int test_case, const KeyType& key) {
iter_test = test_map[test_case].find(key);
iter_std = std_map[test_case].find(key);
CompareLookupResult(test_case);
}
- void LowerBoundTester(int test_case, const KeyType &key) {
+ void LowerBoundTester(int test_case, const KeyType& key) {
iter_test = test_map[test_case].lower_bound(key);
iter_std = std_map[test_case].lower_bound(key);
CompareLookupResult(test_case);
}
- void UpperBoundTester(int test_case, const KeyType &key) {
+ void UpperBoundTester(int test_case, const KeyType& key) {
iter_test = test_map[test_case].upper_bound(key);
iter_std = std_map[test_case].upper_bound(key);
CompareLookupResult(test_case);
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map-inl.h b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map-inl.h
index f6cef1a9eec..37fb6fae4de 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map-inl.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map-inl.h
@@ -43,8 +43,8 @@ namespace google_breakpad {
template<typename AddressType, typename EntryType>
bool StaticRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ const AddressType& address, const EntryType*& entry,
+ AddressType* entry_base, AddressType* entry_size) const {
MapConstIterator iterator = map_.lower_bound(address);
if (iterator == map_.end())
return false;
@@ -55,7 +55,7 @@ bool StaticRangeMap<AddressType, EntryType>::RetrieveRange(
// be below the range's low address, though. When that happens, address
// references something not within any range, so return false.
- const Range *range = iterator.GetValuePtr();
+ const Range* range = iterator.GetValuePtr();
// Make sure AddressType and EntryType are copyable basic types
// e.g.: integer types, pointers etc
@@ -74,8 +74,8 @@ bool StaticRangeMap<AddressType, EntryType>::RetrieveRange(
template<typename AddressType, typename EntryType>
bool StaticRangeMap<AddressType, EntryType>::RetrieveNearestRange(
- const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ const AddressType& address, const EntryType*& entry,
+ AddressType* entry_base, AddressType* entry_size) const {
// If address is within a range, RetrieveRange can handle it.
if (RetrieveRange(address, entry, entry_base, entry_size))
return true;
@@ -91,7 +91,7 @@ bool StaticRangeMap<AddressType, EntryType>::RetrieveNearestRange(
return false;
--iterator;
- const Range *range = iterator.GetValuePtr();
+ const Range* range = iterator.GetValuePtr();
entry = range->entryptr();
if (entry_base)
*entry_base = range->base();
@@ -103,8 +103,8 @@ bool StaticRangeMap<AddressType, EntryType>::RetrieveNearestRange(
template<typename AddressType, typename EntryType>
bool StaticRangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
- int index, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
+ int index, const EntryType*& entry,
+ AddressType* entry_base, AddressType* entry_size) const {
if (index >= GetCount()) {
BPLOG(ERROR) << "Index out of range: " << index << "/" << GetCount();
@@ -113,7 +113,7 @@ bool StaticRangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
MapConstIterator iterator = map_.IteratorAtIndex(index);
- const Range *range = iterator.GetValuePtr();
+ const Range* range = iterator.GetValuePtr();
entry = range->entryptr();
if (entry_base)
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map.h b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map.h
index 91aabb0324a..ea89fae4a89 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map.h
@@ -50,21 +50,21 @@ template<typename AddressType, typename EntryType>
class StaticRangeMap {
public:
StaticRangeMap(): map_() { }
- explicit StaticRangeMap(const char *memory): map_(memory) { }
+ explicit StaticRangeMap(const char* memory): map_(memory) { }
// 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.
- bool RetrieveRange(const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const;
+ bool RetrieveRange(const AddressType& address, const EntryType*& entry,
+ AddressType* entry_base, 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.
- bool RetrieveNearestRange(const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size)
+ bool RetrieveNearestRange(const AddressType& address, const EntryType*& entry,
+ AddressType* entry_base, AddressType* entry_size)
const;
// Treating all ranges as a list ordered by the address spaces that they
@@ -74,8 +74,8 @@ class StaticRangeMap {
// range.
//
// RetrieveRangeAtIndex is not optimized for speedy operation.
- bool RetrieveRangeAtIndex(int index, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size)
+ bool RetrieveRangeAtIndex(int index, const EntryType*& entry,
+ AddressType* entry_base, AddressType* entry_size)
const;
// Returns the number of ranges stored in the RangeMap.
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map_unittest.cc b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map_unittest.cc
index 2821736224a..1593ed00461 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/static_range_map_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/static_range_map_unittest.cc
@@ -414,7 +414,7 @@ TEST_F(TestStaticRangeMap, RunTestCase0Again) {
} // namespace google_breakpad
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.cc b/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.cc
index 5e72c1611d9..da61afc4b86 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.cc
@@ -37,7 +37,7 @@ namespace google_breakpad {
namespace SynthMinidump {
-Section::Section(const Dump &dump)
+Section::Section(const Dump& dump)
: test_assembler::Section(dump.endianness()) { }
void Section::CiteLocationIn(test_assembler::Section *section) const {
@@ -49,9 +49,9 @@ void Stream::CiteStreamIn(test_assembler::Section *section) const {
CiteLocationIn(section);
}
-SystemInfo::SystemInfo(const Dump &dump,
- const MDRawSystemInfo &system_info,
- const String &csd_version)
+SystemInfo::SystemInfo(const Dump& dump,
+ const MDRawSystemInfo& system_info,
+ const String& csd_version)
: Stream(dump, MD_SYSTEM_INFO_STREAM) {
D16(system_info.processor_architecture);
D16(system_info.processor_level);
@@ -108,7 +108,7 @@ const MDRawSystemInfo SystemInfo::windows_x86 = {
const string SystemInfo::windows_x86_csd_version = "Service Pack 2";
-String::String(const Dump &dump, const string &contents) : Section(dump) {
+String::String(const Dump& dump, const string& contents) : Section(dump) {
D32(contents.size() * 2);
for (string::const_iterator i = contents.begin(); i != contents.end(); i++)
D16(*i);
@@ -123,7 +123,7 @@ void Memory::CiteMemoryIn(test_assembler::Section *section) const {
CiteLocationIn(section);
}
-Context::Context(const Dump &dump, const MDRawContextX86 &context)
+Context::Context(const Dump& dump, const MDRawContextX86& context)
: Section(dump) {
// The caller should have properly set the CPU type flag.
// The high 24 bits identify the CPU. Note that context records with no CPU
@@ -173,7 +173,7 @@ Context::Context(const Dump &dump, const MDRawContextX86 &context)
assert(Size() == sizeof(MDRawContextX86));
}
-Context::Context(const Dump &dump, const MDRawContextARM &context)
+Context::Context(const Dump& dump, const MDRawContextARM& context)
: Section(dump) {
// The caller should have properly set the CPU type flag.
assert((context.context_flags & MD_CONTEXT_ARM) ||
@@ -192,7 +192,7 @@ Context::Context(const Dump &dump, const MDRawContextARM &context)
assert(Size() == sizeof(MDRawContextARM));
}
-Context::Context(const Dump &dump, const MDRawContextMIPS &context)
+Context::Context(const Dump& dump, const MDRawContextMIPS& context)
: Section(dump) {
// The caller should have properly set the CPU type flag.
assert(context.context_flags & MD_CONTEXT_MIPS);
@@ -228,8 +228,8 @@ Context::Context(const Dump &dump, const MDRawContextMIPS &context)
assert(Size() == sizeof(MDRawContextMIPS));
}
-Thread::Thread(const Dump &dump,
- uint32_t thread_id, const Memory &stack, const Context &context,
+Thread::Thread(const Dump& dump,
+ uint32_t thread_id, const Memory& stack, const Context& context,
uint32_t suspend_count, uint32_t priority_class,
uint32_t priority, uint64_t teb) : Section(dump) {
D32(thread_id);
@@ -242,13 +242,13 @@ Thread::Thread(const Dump &dump,
assert(Size() == sizeof(MDRawThread));
}
-Module::Module(const Dump &dump,
+Module::Module(const Dump& dump,
uint64_t base_of_image,
uint32_t size_of_image,
- const String &name,
+ const String& name,
uint32_t time_date_stamp,
uint32_t checksum,
- const MDVSFixedFileInfo &version_info,
+ const MDVSFixedFileInfo& version_info,
const Section *cv_record,
const Section *misc_record) : Section(dump) {
D64(base_of_image);
@@ -297,10 +297,10 @@ const MDVSFixedFileInfo Module::stock_version_info = {
0 // file_date_lo
};
-UnloadedModule::UnloadedModule(const Dump &dump,
+UnloadedModule::UnloadedModule(const Dump& dump,
uint64_t base_of_image,
uint32_t size_of_image,
- const String &name,
+ const String& name,
uint32_t checksum,
uint32_t time_date_stamp) : Section(dump) {
D64(base_of_image);
@@ -310,15 +310,15 @@ UnloadedModule::UnloadedModule(const Dump &dump,
name.CiteStringIn(this);
}
-UnloadedModuleList::UnloadedModuleList(const Dump &dump, uint32_t type)
+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,
+Exception::Exception(const Dump& dump,
+ const Context& context,
uint32_t thread_id,
uint32_t exception_code,
uint32_t exception_flags,
@@ -361,22 +361,22 @@ Dump::Dump(uint64_t flags,
assert(Size() == sizeof(MDRawHeader));
}
-Dump &Dump::Add(SynthMinidump::Section *section) {
+Dump& Dump::Add(SynthMinidump::Section *section) {
section->Finish(file_start_ + Size());
Append(*section);
return *this;
}
-Dump &Dump::Add(Stream *stream) {
- Add(static_cast<SynthMinidump::Section *>(stream));
+Dump& Dump::Add(Stream *stream) {
+ Add(static_cast<SynthMinidump::Section*>(stream));
stream->CiteStreamIn(&stream_directory_);
stream_count_++;
return *this;
}
-Dump &Dump::Add(Memory *memory) {
+Dump& Dump::Add(Memory *memory) {
// Add the memory contents themselves to the file.
- Add(static_cast<SynthMinidump::Section *>(memory));
+ Add(static_cast<SynthMinidump::Section*>(memory));
// The memory list is a list of MDMemoryDescriptors, not of actual
// memory elements. Produce a descriptor, and add that to the list.
@@ -386,17 +386,17 @@ Dump &Dump::Add(Memory *memory) {
return *this;
}
-Dump &Dump::Add(Thread *thread) {
+Dump& Dump::Add(Thread *thread) {
thread_list_.Add(thread);
return *this;
}
-Dump &Dump::Add(Module *module) {
+Dump& Dump::Add(Module *module) {
module_list_.Add(module);
return *this;
}
-Dump &Dump::Add(UnloadedModule *unloaded_module) {
+Dump& Dump::Add(UnloadedModule *unloaded_module) {
unloaded_module_list_.Add(unloaded_module);
return *this;
}
@@ -413,7 +413,7 @@ void Dump::Finish() {
// has the stream count and MDRVA.
stream_count_label_ = stream_count_;
stream_directory_rva_ = file_start_ + Size();
- Append(static_cast<test_assembler::Section &>(stream_directory_));
+ Append(static_cast<test_assembler::Section& >(stream_directory_));
}
} // namespace SynthMinidump
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.h b/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.h
index 8f49cfff22a..2da4d5fe995 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/synth_minidump.h
@@ -135,7 +135,7 @@ class String;
// A test_assembler::Section which will be appended to a minidump.
class Section: public test_assembler::Section {
public:
- explicit Section(const Dump &dump);
+ explicit Section(const Dump& dump);
// Append an MDLocationDescriptor referring to this section to SECTION.
// If 'this' is NULL, append a descriptor with a zero length and MDRVA.
@@ -145,13 +145,13 @@ class Section: public test_assembler::Section {
// bad, if such language exists. Having this function handle NULL
// 'this' is convenient, but if it causes trouble, it's not hard to
// do differently.)
- void CiteLocationIn(test_assembler::Section *section) const;
+ void CiteLocationIn(test_assembler::Section* section) const;
// Note that this section's contents are complete, and that it has
// been placed in the minidump file at OFFSET. The 'Add' member
// functions call the Finish member function of the object being
// added for you; if you are 'Add'ing this section, you needn't Finish it.
- virtual void Finish(const Label &offset) {
+ virtual void Finish(const Label& offset) {
file_offset_ = offset; size_ = Size();
}
@@ -166,10 +166,10 @@ class Stream: public Section {
public:
// Create a stream of type TYPE. You can append whatever contents
// you like to this stream using the test_assembler::Section methods.
- Stream(const Dump &dump, uint32_t type) : Section(dump), type_(type) { }
+ Stream(const Dump& dump, uint32_t type) : Section(dump), type_(type) { }
// Append an MDRawDirectory referring to this stream to SECTION.
- void CiteStreamIn(test_assembler::Section *section) const;
+ void CiteStreamIn(test_assembler::Section* section) const;
private:
// The type of this stream.
@@ -186,9 +186,9 @@ class SystemInfo: public Stream {
//
// Remember that you are still responsible for 'Add'ing CSD_VERSION
// to the dump yourself.
- SystemInfo(const Dump &dump,
- const MDRawSystemInfo &system_info,
- const String &csd_version);
+ SystemInfo(const Dump& dump,
+ const MDRawSystemInfo& system_info,
+ const String& csd_version);
// Stock MDRawSystemInfo information and associated strings, for
// writing tests.
@@ -199,10 +199,10 @@ class SystemInfo: public Stream {
// An MDString: a string preceded by a 32-bit length.
class String: public Section {
public:
- String(const Dump &dump, const string &value);
+ String(const Dump& dump, const string& value);
// Append an MDRVA referring to this string to SECTION.
- void CiteStringIn(test_assembler::Section *section) const;
+ void CiteStringIn(test_assembler::Section* section) const;
};
// A range of memory contents. 'Add'ing a memory range to a minidump
@@ -211,11 +211,11 @@ class String: public Section {
// to memory addresses.
class Memory: public Section {
public:
- Memory(const Dump &dump, uint64_t address)
+ Memory(const Dump& dump, uint64_t address)
: Section(dump), address_(address) { start() = address; }
// Append an MDMemoryDescriptor referring to this memory range to SECTION.
- void CiteMemoryIn(test_assembler::Section *section) const;
+ void CiteMemoryIn(test_assembler::Section* section) const;
private:
// The process address from which these memory contents were taken.
@@ -226,11 +226,11 @@ class Memory: public Section {
class Context: public Section {
public:
// Create a context belonging to DUMP whose contents are a copy of CONTEXT.
- Context(const Dump &dump, const MDRawContextX86 &context);
- Context(const Dump &dump, const MDRawContextARM &context);
- Context(const Dump &dump, const MDRawContextMIPS &context);
+ Context(const Dump& dump, const MDRawContextX86& context);
+ Context(const Dump& dump, const MDRawContextARM& context);
+ Context(const Dump& dump, const MDRawContextMIPS& context);
// Add an empty context to the dump.
- Context(const Dump &dump) : Section(dump) {}
+ Context(const Dump& dump) : Section(dump) {}
// Add constructors for other architectures here. Remember to byteswap.
};
@@ -238,10 +238,10 @@ class Thread: public Section {
public:
// Create a thread belonging to DUMP with the given values, citing
// STACK and CONTEXT (which you must Add to the dump separately).
- Thread(const Dump &dump,
+ Thread(const Dump& dump,
uint32_t thread_id,
- const Memory &stack,
- const Context &context,
+ const Memory& stack,
+ const Context& context,
uint32_t suspend_count = 0,
uint32_t priority_class = 0,
uint32_t priority = 0,
@@ -253,15 +253,15 @@ class Module: public Section {
// Create a module with the given values. Note that CV_RECORD and
// MISC_RECORD can be NULL, in which case the corresponding location
// descriptior in the minidump will have a length of zero.
- Module(const Dump &dump,
+ Module(const Dump& dump,
uint64_t base_of_image,
uint32_t size_of_image,
- const String &name,
+ const String& name,
uint32_t time_date_stamp = 1262805309,
uint32_t checksum = 0,
- const MDVSFixedFileInfo &version_info = Module::stock_version_info,
- const Section *cv_record = NULL,
- const Section *misc_record = NULL);
+ const MDVSFixedFileInfo& version_info = Module::stock_version_info,
+ const Section* cv_record = NULL,
+ const Section* misc_record = NULL);
private:
// A standard MDVSFixedFileInfo structure to use as a default for
@@ -272,18 +272,18 @@ class Module: public Section {
class UnloadedModule: public Section {
public:
- UnloadedModule(const Dump &dump,
+ UnloadedModule(const Dump& dump,
uint64_t base_of_image,
uint32_t size_of_image,
- const String &name,
+ const String& name,
uint32_t checksum = 0,
uint32_t time_date_stamp = 1262805309);
};
class Exception : public Stream {
public:
- Exception(const Dump &dump,
- const Context &context,
+ Exception(const Dump& dump,
+ const Context& context,
uint32_t thread_id = 0,
uint32_t exception_code = 0,
uint32_t exception_flags = 0,
@@ -295,12 +295,12 @@ public:
template<typename Element>
class List: public Stream {
public:
- List(const Dump &dump, uint32_t type) : Stream(dump, type), count_(0) {
+ List(const Dump& dump, uint32_t type) : Stream(dump, type), count_(0) {
D32(count_label_);
}
// Add ELEMENT to this list.
- void Add(Element *element) {
+ void Add(Element* element) {
element->Finish(file_offset_ + Size());
Append(*element);
count_++;
@@ -311,7 +311,7 @@ class List: public Stream {
// Finish up the contents of this section, mark it as having been
// placed at OFFSET.
- virtual void Finish(const Label &offset) {
+ virtual void Finish(const Label& offset) {
Stream::Finish(offset);
count_label_ = count_;
}
@@ -322,14 +322,14 @@ class List: public Stream {
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) {}
+ 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);
+ UnloadedModuleList(const Dump& dump, uint32_t type);
};
class Dump: public test_assembler::Section {
@@ -349,12 +349,12 @@ class Dump: public test_assembler::Section {
// whatever directory or list is appropriate for its type. The
// stream directory, memory list, thread list, and module list are
// accumulated this way.
- Dump &Add(SynthMinidump::Section *object); // simply append data
- Dump &Add(Stream *object); // append, record in stream directory
- 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
+ Dump& Add(SynthMinidump::Section* object); // simply append data
+ Dump& Add(Stream* object); // append, record in stream directory
+ 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
@@ -367,26 +367,26 @@ class Dump: public test_assembler::Section {
Label file_start_;
// The stream directory. We construct this incrementally from
- // Add(Stream *) calls.
+ // Add(Stream*) calls.
SynthMinidump::Section stream_directory_; // The directory's contents.
size_t stream_count_; // The number of streams so far.
Label stream_count_label_; // Cited in file header.
Label stream_directory_rva_; // The directory's file offset.
// This minidump's thread list. We construct this incrementally from
- // Add(Thread *) calls.
+ // Add(Thread*) calls.
List<Thread> thread_list_;
// This minidump's module list. We construct this incrementally from
- // Add(Module *) calls.
+ // Add(Module*) calls.
List<Module> module_list_;
// This minidump's unloaded module list. We construct this incrementally from
- // Add(UnloadedModule *) calls.
+ // 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,
+ // Add(Memory*) calls. This is actually a list of MDMemoryDescriptors,
// not memory ranges --- thus the odd type.
List<SynthMinidump::Section> memory_list_;
};
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/tokenize.cc b/chromium/third_party/breakpad/breakpad/src/processor/tokenize.cc
index 8fce87a2243..29e8125abb8 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/tokenize.cc
+++ b/chromium/third_party/breakpad/breakpad/src/processor/tokenize.cc
@@ -42,10 +42,10 @@ namespace google_breakpad {
using std::vector;
-bool Tokenize(char *line,
- const char *separators,
- int max_tokens,
- vector<char*> *tokens) {
+bool Tokenize(char* line,
+ const char* separators,
+ int max_tokens,
+ vector<char*>* tokens) {
tokens->clear();
tokens->reserve(max_tokens);
@@ -53,8 +53,8 @@ bool Tokenize(char *line,
// Split tokens on the separator character.
// strip them out before exhausting max_tokens.
- char *save_ptr;
- char *token = strtok_r(line, separators, &save_ptr);
+ char* save_ptr;
+ char* token = strtok_r(line, separators, &save_ptr);
while (token && --remaining > 0) {
tokens->push_back(token);
if (remaining > 1)
@@ -69,10 +69,9 @@ bool Tokenize(char *line,
return tokens->size() == static_cast<unsigned int>(max_tokens);
}
-void StringToVector(const string &str, vector<char> &vec) {
+void StringToVector(const string& str, vector<char>& vec) {
vec.resize(str.length() + 1);
- std::copy(str.begin(), str.end(),
- vec.begin());
+ std::copy(str.begin(), str.end(), vec.begin());
vec[str.length()] = '\0';
}
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/tokenize.h b/chromium/third_party/breakpad/breakpad/src/processor/tokenize.h
index 9ff571d5c5c..c4480aa80f7 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/tokenize.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/tokenize.h
@@ -50,13 +50,13 @@ namespace google_breakpad {
// Tokenize, but may be treated as a failure if the caller expects an
// exact, as opposed to maximum, number of tokens.
-bool Tokenize(char *line,
- const char *separators,
+bool Tokenize(char* line,
+ const char* separators,
int max_tokens,
- std::vector<char*> *tokens);
+ std::vector<char*>* tokens);
// For convenience, since you need a char* to pass to Tokenize.
// You can call StringToVector on a string, and use &vec[0].
-void StringToVector(const string &str, std::vector<char> &vec);
+void StringToVector(const string& str, std::vector<char>& vec);
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/processor/windows_frame_info.h b/chromium/third_party/breakpad/breakpad/src/processor/windows_frame_info.h
index f96e0a438c8..993832ad772 100644
--- a/chromium/third_party/breakpad/breakpad/src/processor/windows_frame_info.h
+++ b/chromium/third_party/breakpad/breakpad/src/processor/windows_frame_info.h
@@ -113,9 +113,9 @@ struct WindowsFrameInfo {
// otherwise. type, rva and code_size are present in the STACK line,
// but not the StackFrameInfo structure, so return them as outparams.
static WindowsFrameInfo *ParseFromString(const string string,
- int &type,
- uint64_t &rva,
- uint64_t &code_size) {
+ int& type,
+ uint64_t& rva,
+ uint64_t& code_size) {
// The format of a STACK WIN record is documented at:
//
// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
@@ -160,7 +160,7 @@ struct WindowsFrameInfo {
}
// CopyFrom makes "this" WindowsFrameInfo object identical to "that".
- void CopyFrom(const WindowsFrameInfo &that) {
+ void CopyFrom(const WindowsFrameInfo& that) {
type_ = that.type_;
valid = that.valid;
prolog_size = that.prolog_size;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/linux/dump_syms/dump_syms.cc b/chromium/third_party/breakpad/breakpad/src/tools/linux/dump_syms/dump_syms.cc
index ebdf23146c3..42e582c6ef6 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/linux/dump_syms/dump_syms.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/linux/dump_syms/dump_syms.cc
@@ -56,7 +56,7 @@ int usage(const char* self) {
return 1;
}
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
if (argc < 2)
return usage(argv[0]);
bool header_only = false;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc b/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
index a60be323545..aade82c996d 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
@@ -149,7 +149,7 @@ SetupOptions(int argc, const char* argv[], Options* options) {
options->use_filename = false;
options->inc_guid = false;
- while ((ch = getopt(argc, (char * const *)argv, "fhio:S:v")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "fhio:S:v")) != -1) {
switch (ch) {
case 'h':
Usage(argc, argv);
@@ -224,7 +224,7 @@ writea(int fd, const void* idata, size_t length) {
*/
static inline int sex() {
int probe = 1;
- return !*(char *)&probe;
+ return !*(char*)&probe;
}
typedef struct elf_timeval { /* Time value with microsecond resolution */
@@ -660,10 +660,10 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64) {
fputs("Vendor id: ", stderr);
const char *nul =
- (const char *)memchr(sysinfo->cpu.x86_cpu_info.vendor_id, 0,
+ (const char*)memchr(sysinfo->cpu.x86_cpu_info.vendor_id, 0,
sizeof(sysinfo->cpu.x86_cpu_info.vendor_id));
fwrite(sysinfo->cpu.x86_cpu_info.vendor_id,
- nul ? nul - (const char *)&sysinfo->cpu.x86_cpu_info.vendor_id[0]
+ nul ? nul - (const char*)&sysinfo->cpu.x86_cpu_info.vendor_id[0]
: sizeof(sysinfo->cpu.x86_cpu_info.vendor_id), 1, stderr);
fputs("\n", stderr);
}
@@ -759,7 +759,7 @@ ParseEnvironment(const Options& options, CrashedProcess* crashinfo,
memcpy(env, range.data(), range.length());
int nul_count = 0;
for (char *ptr = env;;) {
- ptr = (char *)memchr(ptr, '\000', range.length() - (ptr - env));
+ ptr = (char*)memchr(ptr, '\000', range.length() - (ptr - env));
if (!ptr) {
break;
}
@@ -1076,7 +1076,7 @@ AugmentMappings(const Options& options, CrashedProcess* crashinfo,
for (unsigned i = 0; i < crashinfo->threads.size(); ++i) {
const CrashedProcess::Thread& thread = crashinfo->threads[i];
AddDataToMapping(crashinfo,
- string((char *)thread.stack, thread.stack_length),
+ string((char*)thread.stack, thread.stack_length),
thread.stack_addr);
}
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/minidump_upload.cc b/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/minidump_upload.cc
index 19f17450a1d..f24e9716d93 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/minidump_upload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/minidump_upload.cc
@@ -111,7 +111,7 @@ SetupOptions(int argc, const char *argv[], Options *options) {
extern int optind;
int ch;
- while ((ch = getopt(argc, (char * const *)argv, "p:u:v:x:h?")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "p:u:v:x:h?")) != -1) {
switch (ch) {
case 'p':
options->product = optarg;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/sym_upload.cc b/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/sym_upload.cc
index f155eb9552a..57df81cf7d8 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/sym_upload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/linux/symupload/sym_upload.cc
@@ -111,16 +111,20 @@ Usage(int argc, const char *argv[]) {
//=============================================================================
static void
SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
+ extern int optind, optopt;
int ch;
constexpr char flag_pattern[] = "u:v:x:p:k:t:c:i:hf?";
- while ((ch = getopt(argc, (char * const *)argv, flag_pattern)) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, flag_pattern)) != -1) {
switch (ch) {
case 'h':
case '?':
Usage(argc, argv);
- exit(0);
+ // ch might be '?' because getopt found an error while parsing args (as
+ // opposed to finding "-?" as an arg), in which case optopt is set to
+ // the bad arg value, so return an error code if optopt is set,
+ // otherwise exit cleanly.
+ exit(optopt == 0 ? 0 : 1);
break;
case 'u':
options->proxy_user_pwd = optarg;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h
index 3fbe108ebdd..69b41405cf9 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h
@@ -47,30 +47,30 @@ class OnDemandSymbolSupplier : public SymbolSupplier {
public:
// |search_dir| is the directory to search for alternative symbols with
// the same name as the module in the minidump
- OnDemandSymbolSupplier(const string &search_dir,
- const string &symbol_search_dir);
+ OnDemandSymbolSupplier(const string& search_dir,
+ const string& symbol_search_dir);
virtual ~OnDemandSymbolSupplier() {}
// Returns the path to the symbol file for the given module.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file);
// Returns the path to the symbol file for the given module.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
+ virtual SymbolResult GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data);
// Allocates data buffer on heap, and takes the ownership of
// the data buffer.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
+ virtual SymbolResult GetCStringSymbolData(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size);
// Delete the data buffer allocated for module in GetCStringSymbolData().
- virtual void FreeSymbolData(const CodeModule *module);
+ virtual void FreeSymbolData(const CodeModule* module);
protected:
// Search directory
@@ -82,28 +82,28 @@ class OnDemandSymbolSupplier : public SymbolSupplier {
map<string, string> module_file_map_;
// Map of allocated data buffers, keyed by module->code_file().
- map<string, char *> memory_buffers_;
+ map<string, char*> memory_buffers_;
// Return the name for |module| This will be the value used as the key
// to the |module_file_map_|.
- string GetNameForModule(const CodeModule *module);
+ string GetNameForModule(const CodeModule* module);
// Find the module on local system. If the module resides in a different
// location than the full path in the minidump, this will be the location
// used.
- string GetLocalModulePath(const CodeModule *module);
+ string GetLocalModulePath(const CodeModule* module);
// Return the full path for |module|.
- string GetModulePath(const CodeModule *module);
+ string GetModulePath(const CodeModule* module);
// Return the path to the symbol file for |module|. If an empty string is
// returned, then |module| doesn't have a symbol file.
- string GetModuleSymbolFile(const CodeModule *module);
+ string GetModuleSymbolFile(const CodeModule* module);
// Generate the breakpad symbol file for |module|. Return true if successful.
// File is generated in /tmp.
- bool GenerateSymbolFile(const CodeModule *module,
- const SystemInfo *system_info);
+ bool GenerateSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info);
};
} // namespace google_breakpad
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
index 1955d2667b5..cfcecee8cad 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
@@ -51,10 +51,10 @@ using google_breakpad::PathnameStripper;
using google_breakpad::SymbolSupplier;
using google_breakpad::SystemInfo;
-OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir,
- const string &symbol_search_dir)
+OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string& search_dir,
+ const string& symbol_search_dir)
: search_dir_(search_dir) {
- NSFileManager *mgr = [NSFileManager defaultManager];
+ NSFileManager* mgr = [NSFileManager defaultManager];
size_t length = symbol_search_dir.length();
if (length) {
// Load all sym files in symbol_search_dir into our module_file_map
@@ -62,51 +62,51 @@ OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir,
// MODULE mac x86 BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon
// or
// MODULE mac ppc BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon
- const char *symbolSearchStr = symbol_search_dir.c_str();
- NSString *symbolSearchPath =
+ const char* symbolSearchStr = symbol_search_dir.c_str();
+ NSString* symbolSearchPath =
[mgr stringWithFileSystemRepresentation:symbolSearchStr
length:strlen(symbolSearchStr)];
- NSDirectoryEnumerator *dirEnum = [mgr enumeratorAtPath:symbolSearchPath];
- NSString *fileName;
- NSCharacterSet *hexSet =
+ NSDirectoryEnumerator* dirEnum = [mgr enumeratorAtPath:symbolSearchPath];
+ NSString* fileName;
+ NSCharacterSet* hexSet =
[NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"];
- NSCharacterSet *newlineSet =
+ NSCharacterSet* newlineSet =
[NSCharacterSet characterSetWithCharactersInString:@"\r\n"];
while ((fileName = [dirEnum nextObject])) {
// Check to see what type of file we have
- NSDictionary *attrib = [dirEnum fileAttributes];
- NSString *fileType = [attrib objectForKey:NSFileType];
+ NSDictionary* attrib = [dirEnum fileAttributes];
+ NSString* fileType = [attrib objectForKey:NSFileType];
if ([fileType isEqualToString:NSFileTypeDirectory]) {
// Skip subdirectories
[dirEnum skipDescendents];
} else {
- NSString *filePath = [symbolSearchPath stringByAppendingPathComponent:fileName];
- NSString *dataStr = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL];
+ NSString* filePath = [symbolSearchPath stringByAppendingPathComponent:fileName];
+ NSString* dataStr = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL];
if (dataStr) {
// Check file to see if it is of appropriate type, and grab module
// name.
- NSScanner *scanner = [NSScanner scannerWithString:dataStr];
+ NSScanner* scanner = [NSScanner scannerWithString:dataStr];
BOOL goodScan = [scanner scanString:@"MODULE mac " intoString:nil];
if (goodScan) {
goodScan = ([scanner scanString:@"x86 " intoString:nil] ||
[scanner scanString:@"x86_64 " intoString:nil] ||
[scanner scanString:@"ppc " intoString:nil]);
if (goodScan) {
- NSString *moduleID;
+ NSString* moduleID;
goodScan = [scanner scanCharactersFromSet:hexSet
intoString:&moduleID];
if (goodScan) {
// Module IDs are always 33 chars long
goodScan = [moduleID length] == 33;
if (goodScan) {
- NSString *moduleName;
+ NSString* moduleName;
goodScan = [scanner scanUpToCharactersFromSet:newlineSet
intoString:&moduleName];
if (goodScan) {
goodScan = [moduleName length] > 0;
if (goodScan) {
- const char *moduleNameStr = [moduleName UTF8String];
- const char *filePathStr = [filePath fileSystemRepresentation];
+ const char* moduleNameStr = [moduleName UTF8String];
+ const char* filePathStr = [filePath fileSystemRepresentation];
// Map our file
module_file_map_[moduleNameStr] = filePathStr;
}
@@ -122,9 +122,9 @@ OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir,
}
SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) {
+OnDemandSymbolSupplier::GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file) {
string path(GetModuleSymbolFile(module));
if (path.empty()) {
@@ -142,10 +142,10 @@ OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
}
SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
+OnDemandSymbolSupplier::GetSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ string* symbol_data) {
SymbolSupplier::SymbolResult s = GetSymbolFile(module,
system_info,
symbol_file);
@@ -162,11 +162,11 @@ OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
}
SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
+OnDemandSymbolSupplier::GetCStringSymbolData(const CodeModule* module,
+ const SystemInfo* system_info,
+ string* symbol_file,
+ char** symbol_data,
+ size_t* symbol_data_size) {
std::string symbol_data_string;
SymbolSupplier::SymbolResult result = GetSymbolFile(module,
system_info,
@@ -186,21 +186,21 @@ OnDemandSymbolSupplier::GetCStringSymbolData(const CodeModule *module,
return result;
}
-void OnDemandSymbolSupplier::FreeSymbolData(const CodeModule *module) {
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
+void OnDemandSymbolSupplier::FreeSymbolData(const CodeModule* module) {
+ map<string, char*>::iterator it = memory_buffers_.find(module->code_file());
if (it != memory_buffers_.end()) {
delete [] it->second;
memory_buffers_.erase(it);
}
}
-string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) {
- NSFileManager *mgr = [NSFileManager defaultManager];
- const char *moduleStr = module->code_file().c_str();
- NSString *modulePath =
+string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule* module) {
+ NSFileManager* mgr = [NSFileManager defaultManager];
+ const char* moduleStr = module->code_file().c_str();
+ NSString* modulePath =
[mgr stringWithFileSystemRepresentation:moduleStr length:strlen(moduleStr)];
- const char *searchStr = search_dir_.c_str();
- NSString *searchDir =
+ const char* searchStr = search_dir_.c_str();
+ NSString* searchDir =
[mgr stringWithFileSystemRepresentation:searchStr length:strlen(searchStr)];
if ([mgr fileExistsAtPath:modulePath])
@@ -209,9 +209,9 @@ string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) {
// If the module is not found, try to start appending the components to the
// search string and stop if a file (not dir) is found or all components
// have been appended
- NSArray *pathComponents = [modulePath componentsSeparatedByString:@"/"];
+ NSArray* pathComponents = [modulePath componentsSeparatedByString:@"/"];
size_t count = [pathComponents count];
- NSMutableString *path = [NSMutableString string];
+ NSMutableString* path = [NSMutableString string];
for (size_t i = 0; i < count; ++i) {
[path setString:searchDir];
@@ -230,22 +230,22 @@ string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) {
return "";
}
-string OnDemandSymbolSupplier::GetModulePath(const CodeModule *module) {
+string OnDemandSymbolSupplier::GetModulePath(const CodeModule* module) {
return module->code_file();
}
-string OnDemandSymbolSupplier::GetNameForModule(const CodeModule *module) {
+string OnDemandSymbolSupplier::GetNameForModule(const CodeModule* module) {
return PathnameStripper::File(module->code_file());
}
-string OnDemandSymbolSupplier::GetModuleSymbolFile(const CodeModule *module) {
+string OnDemandSymbolSupplier::GetModuleSymbolFile(const CodeModule* module) {
string name(GetNameForModule(module));
map<string, string>::iterator result = module_file_map_.find(name);
return (result == module_file_map_.end()) ? "" : (*result).second;
}
-static float GetFileModificationTime(const char *path) {
+static float GetFileModificationTime(const char* path) {
float result = 0;
struct stat file_stat;
if (stat(path, &file_stat) == 0)
@@ -255,12 +255,12 @@ static float GetFileModificationTime(const char *path) {
return result;
}
-bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module,
- const SystemInfo *system_info) {
+bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule* module,
+ const SystemInfo* system_info) {
bool result = true;
string name = GetNameForModule(module);
string module_path = GetLocalModulePath(module);
- NSString *symbol_path = [NSString stringWithFormat:@"/tmp/%s.%s.sym",
+ NSString* symbol_path = [NSString stringWithFormat:@"/tmp/%s.%s.sym",
name.c_str(), system_info->cpu.c_str()];
if (module_path.empty())
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc b/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc
index 6f68457b4c1..8d73f0bdde8 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc
@@ -106,7 +106,7 @@ static void CopyCFIDataBetweenModules(Module* to_module,
}
}
-static bool Start(const Options &options) {
+static bool Start(const Options& options) {
SymbolData symbol_data = options.cfi ? ALL_SYMBOL_DATA : NO_CFI;
DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs);
@@ -210,7 +210,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
extern int optind;
signed char ch;
- while ((ch = getopt(argc, (char * const *)argv, "ia:g:chr?")) != -1) {
+ while ((ch = getopt(argc, (char * const*)argv, "ia:g:chr?")) != -1) {
switch (ch) {
case 'i':
options->header_only = true;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/macho_dump.cc b/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/macho_dump.cc
index 6e784ca7098..34f82ab1fcb 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/macho_dump.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/dump_syms/macho_dump.cc
@@ -60,7 +60,7 @@ namespace mach_o = google_breakpad::mach_o;
string program_name;
-int check_syscall(int result, const char *operation, const char *filename) {
+int check_syscall(int result, const char* operation, const char* filename) {
if (result < 0) {
fprintf(stderr, "%s: %s '%s': %s\n",
program_name.c_str(), operation,
@@ -73,7 +73,7 @@ int check_syscall(int result, const char *operation, const char *filename) {
class DumpSection: public mach_o::Reader::SectionHandler {
public:
DumpSection() : index_(0) { }
- bool HandleSection(const mach_o::Section &section) {
+ bool HandleSection(const mach_o::Section& section) {
printf(" section %d '%s' in segment '%s'\n"
" address: 0x%llx\n"
" alignment: 1 << %d B\n"
@@ -92,13 +92,13 @@ class DumpSection: public mach_o::Reader::SectionHandler {
class DumpCommand: public mach_o::Reader::LoadCommandHandler {
public:
- DumpCommand(mach_o::Reader *reader) : reader_(reader), index_(0) { }
+ DumpCommand(mach_o::Reader* reader) : reader_(reader), index_(0) { }
bool UnknownCommand(mach_o::LoadCommandType type,
- const ByteBuffer &contents) {
+ const ByteBuffer& contents) {
printf(" load command %d: %d", index_++, type);
return true;
}
- bool SegmentCommand(const mach_o::Segment &segment) {
+ bool SegmentCommand(const mach_o::Segment& segment) {
printf(" load command %d: %s-bit segment '%s'\n"
" address: 0x%llx\n"
" memory size: 0x%llx\n"
@@ -115,24 +115,24 @@ class DumpCommand: public mach_o::Reader::LoadCommandHandler {
return reader_->WalkSegmentSections(segment, &dump_section);
}
private:
- mach_o::Reader *reader_;
+ mach_o::Reader* reader_;
int index_;
};
-void DumpFile(const char *filename) {
+void DumpFile(const char* filename) {
int fd = check_syscall(open(filename, O_RDONLY), "opening", filename);
struct stat attributes;
check_syscall(fstat(fd, &attributes),
"getting file attributes for", filename);
- void *mapping = mmap(NULL, attributes.st_size, PROT_READ,
+ void* mapping = mmap(NULL, attributes.st_size, PROT_READ,
MAP_PRIVATE, fd, 0);
close(fd);
- check_syscall(mapping == (void *)-1 ? -1 : 0,
+ check_syscall(mapping == (void*)-1 ? -1 : 0,
"mapping contents of", filename);
mach_o::FatReader::Reporter fat_reporter(filename);
mach_o::FatReader fat_reader(&fat_reporter);
- if (!fat_reader.Read(reinterpret_cast<uint8_t *>(mapping),
+ if (!fat_reader.Read(reinterpret_cast<uint8_t*>(mapping),
attributes.st_size)) {
exit(1);
}
@@ -140,14 +140,14 @@ void DumpFile(const char *filename) {
size_t object_files_size;
const SuperFatArch* super_fat_object_files =
fat_reader.object_files(&object_files_size);
- struct fat_arch *object_files;
+ 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];
- const NXArchInfo *fat_arch_info =
+ const struct fat_arch& file = object_files[i];
+ const NXArchInfo* fat_arch_info =
google_breakpad::BreakpadGetArchInfoFromCpuType(
file.cputype, file.cpusubtype);
printf("\n object file %ld:\n"
@@ -162,7 +162,7 @@ void DumpFile(const char *filename) {
name << filename;
if (object_files_size > 1)
name << ", object file #" << i;
- ByteBuffer file_contents(reinterpret_cast<uint8_t *>(mapping)
+ ByteBuffer file_contents(reinterpret_cast<uint8_t*>(mapping)
+ file.offset, file.size);
mach_o::Reader::Reporter reporter(name.str());
mach_o::Reader reader(&reporter);
@@ -170,7 +170,7 @@ void DumpFile(const char *filename) {
exit(1);
}
- const NXArchInfo *macho_arch_info =
+ const NXArchInfo* macho_arch_info =
NXGetArchInfoFromCpuType(reader.cpu_type(),
reader.cpu_subtype());
printf(" Mach-O header:\n"
@@ -190,7 +190,7 @@ void DumpFile(const char *filename) {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
program_name = google_breakpad::BaseName(argv[0]);
if (argc == 1) {
fprintf(stderr, "Usage: %s FILE ...\n"
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.m b/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.m
index a7cce7b00cc..2c663fe13b4 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.m
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.m
@@ -43,28 +43,43 @@
#include <unistd.h>
#include <Foundation/Foundation.h>
+
#include "HTTPMultipartUpload.h"
+#include "HTTPPutRequest.h"
+#include "SymbolCollectorClient.h"
+
+typedef enum { kSymUploadProtocolV1, kSymUploadProtocolV2 } SymUploadProtocol;
+
+typedef enum {
+ kResultSuccess = 0,
+ kResultFailure = 1,
+ kResultAlreadyExists = 2
+} Result;
typedef struct {
- NSString *symbolsPath;
- NSString *uploadURLStr;
- BOOL success;
+ NSString* symbolsPath;
+ NSString* uploadURLStr;
+ SymUploadProtocol symUploadProtocol;
+ NSString* apiKey;
+ BOOL force;
+ Result result;
} Options;
//=============================================================================
-static NSArray *ModuleDataForSymbolFile(NSString *file) {
- NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:file];
- NSData *data = [fh readDataOfLength:1024];
- NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- NSScanner *scanner = [NSScanner scannerWithString:str];
- NSString *line;
- NSMutableArray *parts = nil;
+static NSArray* ModuleDataForSymbolFile(NSString* file) {
+ NSFileHandle* fh = [NSFileHandle fileHandleForReadingAtPath:file];
+ NSData* data = [fh readDataOfLength:1024];
+ NSString* str = [[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding];
+ NSScanner* scanner = [NSScanner scannerWithString:str];
+ NSString* line;
+ NSMutableArray* parts = nil;
const int MODULE_ID_INDEX = 3;
-
+
if ([scanner scanUpToString:@"\n" intoString:&line]) {
parts = [[NSMutableArray alloc] init];
- NSScanner *moduleInfoScanner = [NSScanner scannerWithString:line];
- NSString *moduleInfo;
+ NSScanner* moduleInfoScanner = [NSScanner scannerWithString:line];
+ NSString* moduleInfo;
// Get everything BEFORE the module name. None of these properties
// can have spaces.
for (int i = 0; i <= MODULE_ID_INDEX; i++) {
@@ -84,15 +99,12 @@ static NSArray *ModuleDataForSymbolFile(NSString *file) {
}
//=============================================================================
-static void Start(Options *options) {
- NSURL *url = [NSURL URLWithString:options->uploadURLStr];
- HTTPMultipartUpload *ul = [[HTTPMultipartUpload alloc] initWithURL:url];
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
- NSArray *moduleParts = ModuleDataForSymbolFile(options->symbolsPath);
- NSMutableString *compactedID =
- [NSMutableString stringWithString:[moduleParts objectAtIndex:3]];
- [compactedID replaceOccurrencesOfString:@"-" withString:@"" options:0
- range:NSMakeRange(0, [compactedID length])];
+static void StartSymUploadProtocolV1(Options* options,
+ NSArray* moduleParts,
+ NSString* compactedID) {
+ NSURL* url = [NSURL URLWithString:options->uploadURLStr];
+ HTTPMultipartUpload* ul = [[HTTPMultipartUpload alloc] initWithURL:url];
+ NSMutableDictionary* parameters = [NSMutableDictionary dictionary];
// Add parameters
[parameters setObject:compactedID forKey:@"debug_identifier"];
@@ -104,56 +116,185 @@ static void Start(Options *options) {
[parameters setObject:[moduleParts objectAtIndex:4] forKey:@"debug_file"];
[parameters setObject:[moduleParts objectAtIndex:4] forKey:@"code_file"];
[ul setParameters:parameters];
-
- NSArray *keys = [parameters allKeys];
+
+ NSArray* keys = [parameters allKeys];
int count = [keys count];
for (int i = 0; i < count; ++i) {
- NSString *key = [keys objectAtIndex:i];
- NSString *value = [parameters objectForKey:key];
- fprintf(stdout, "'%s' = '%s'\n", [key UTF8String],
- [value UTF8String]);
+ NSString* key = [keys objectAtIndex:i];
+ NSString* value = [parameters objectForKey:key];
+ fprintf(stdout, "'%s' = '%s'\n", [key UTF8String], [value UTF8String]);
}
// Add file
[ul addFileAtPath:options->symbolsPath name:@"symbol_file"];
// Send it
- NSError *error = nil;
- NSData *data = [ul send:&error];
- NSString *result = [[NSString alloc] initWithData:data
+ NSError* error = nil;
+ NSData* data = [ul send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
int status = [[ul response] statusCode];
- fprintf(stdout, "Send: %s\n", error ? [[error description] UTF8String] :
- "No Error");
+ fprintf(stdout, "Send: %s\n",
+ error ? [[error description] UTF8String] : "No Error");
fprintf(stdout, "Response: %d\n", status);
- fprintf(stdout, "Result: %lu bytes\n%s\n",
- (unsigned long)[data length], [result UTF8String]);
+ fprintf(stdout, "Result: %lu bytes\n%s\n", (unsigned long)[data length],
+ [result UTF8String]);
[result release];
[ul release];
- options->success = !error && status==200;
+ options->result = (!error && status == 200) ? kResultSuccess : kResultFailure;
}
//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
+static void StartSymUploadProtocolV2(Options* options,
+ NSArray* moduleParts,
+ NSString* debugID) {
+ options->result = kResultFailure;
+
+ NSString* debugFile = [moduleParts objectAtIndex:4];
+ if (!options->force) {
+ SymbolStatus symbolStatus =
+ [SymbolCollectorClient checkSymbolStatusOnServer:options->uploadURLStr
+ withAPIKey:options->apiKey
+ withDebugFile:debugFile
+ withDebugID:debugID];
+ if (symbolStatus == SymbolStatusFound) {
+ fprintf(stdout, "Symbol file already exists, upload aborted."
+ " Use \"-f\" to overwrite.\n");
+ options->result = kResultAlreadyExists;
+ return;
+ } else if (symbolStatus == SymbolStatusUnknown) {
+ fprintf(stdout, "Failed to get check for existing symbol.\n");
+ return;
+ }
+ }
+
+ UploadURLResponse* URLResponse =
+ [SymbolCollectorClient createUploadURLOnServer:options->uploadURLStr
+ withAPIKey:options->apiKey];
+ if (URLResponse == nil) {
+ return;
+ }
+
+ NSURL* uploadURL = [NSURL URLWithString:[URLResponse uploadURL]];
+ HTTPPutRequest* putRequest = [[HTTPPutRequest alloc] initWithURL:uploadURL];
+ [putRequest setFile:options->symbolsPath];
+
+ NSError* error = nil;
+ NSData* data = [putRequest send:&error];
+ NSString* result = [[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding];
+ int responseCode = [[putRequest response] statusCode];
+ [putRequest release];
+
+ if (error || responseCode != 200) {
+ fprintf(stdout, "Failed to upload symbol file.\n");
+ fprintf(stdout, "Response code: %d\n", responseCode);
+ fprintf(stdout, "Response:\n");
+ fprintf(stdout, "%s\n", [result UTF8String]);
+ return;
+ }
+
+ CompleteUploadResult completeUploadResult =
+ [SymbolCollectorClient completeUploadOnServer:options->uploadURLStr
+ withAPIKey:options->apiKey
+ withUploadKey:[URLResponse uploadKey]
+ withDebugFile:debugFile
+ withDebugID:debugID];
+ [URLResponse release];
+ if (completeUploadResult == CompleteUploadResultError) {
+ fprintf(stdout, "Failed to complete upload.\n");
+ return;
+ } else if (completeUploadResult == CompleteUploadResultDuplicateData) {
+ fprintf(stdout, "Uploaded file checksum matched existing file checksum,"
+ " no change necessary.\n");
+ } else {
+ fprintf(stdout, "Successfully sent the symbol file.\n");
+ }
+ options->result = kResultSuccess;
+}
+
+//=============================================================================
+static void Start(Options* options) {
+ NSArray* moduleParts = ModuleDataForSymbolFile(options->symbolsPath);
+ NSMutableString* compactedID =
+ [NSMutableString stringWithString:[moduleParts objectAtIndex:3]];
+ [compactedID replaceOccurrencesOfString:@"-"
+ withString:@""
+ options:0
+ range:NSMakeRange(0, [compactedID length])];
+
+ if (options->symUploadProtocol == kSymUploadProtocolV1) {
+ StartSymUploadProtocolV1(options, moduleParts, compactedID);
+ } else if (options->symUploadProtocol == kSymUploadProtocolV2) {
+ StartSymUploadProtocolV2(options, moduleParts, compactedID);
+ }
+}
+
+//=============================================================================
+static void Usage(int argc, const char* argv[]) {
fprintf(stderr, "Submit symbol information.\n");
- fprintf(stderr, "Usage: %s <symbols> <upload-URL>\n", argv[0]);
- fprintf(stderr, "<symbols> should be created by using the dump_syms tool.\n");
- fprintf(stderr, "<upload-URL> is the destination for the upload\n");
+ fprintf(stderr, "Usage: %s [options] <symbol-file> <upload-URL>\n", argv[0]);
+ 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, "Options:\n");
+ fprintf(stderr, "\t-p <protocol>: protocol to use for upload, accepts "
+ "[\"sym-upload-v1\", \"sym-upload-v2\"]. Default is "
+ "\"sym-upload-v1\".\n");
+ fprintf(stderr, "\t-k <api-key>: secret for authentication with upload "
+ "server. [Only in sym-upload-v2 protocol mode]\n");
+ fprintf(stderr, "\t-f: Overwrite symbol file on server if already present. "
+ "[Only in sym-upload-v2 protocol mode]\n");
fprintf(stderr, "\t-h: Usage\n");
fprintf(stderr, "\t-?: Usage\n");
+ fprintf(stderr, "Exit codes:\n");
+ fprintf(stderr, "\t%d: Success\n", kResultSuccess);
+ fprintf(stderr, "\t%d: Failure\n", kResultFailure);
+ fprintf(stderr,
+ "\t%d: Symbol file already exists on server (and -f was not "
+ "specified).\n",
+ kResultAlreadyExists);
+ fprintf(stderr,
+ "\t [This exit code will only be returned by the sym-upload-v2 "
+ "protocol.\n");
+ fprintf(stderr,
+ "\t The sym-upload-v1 protocol can return either Success or "
+ "Failure\n");
+ fprintf(stderr, "\t in this case, and the action taken by the server is "
+ "unspecified.]\n");
}
//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
+static void SetupOptions(int argc, const char* argv[], Options* options) {
+ // Set default value of symUploadProtocol.
+ options->symUploadProtocol = kSymUploadProtocolV1;
+
extern int optind;
char ch;
- while ((ch = getopt(argc, (char * const *)argv, "h?")) != -1) {
+ while ((ch = getopt(argc, (char* const*)argv, "p:k:hf?")) != -1) {
switch (ch) {
+ case 'p':
+ if (strcmp(optarg, "sym-upload-v2") == 0) {
+ options->symUploadProtocol = kSymUploadProtocolV2;
+ break;
+ } else if (strcmp(optarg, "sym-upload-v1") == 0) {
+ // This is already the default but leave in case that changes.
+ options->symUploadProtocol = kSymUploadProtocolV1;
+ break;
+ }
+ Usage(argc, argv);
+ exit(0);
+ break;
+ case 'k':
+ options->apiKey = [NSString stringWithCString:optarg
+ encoding:NSASCIIStringEncoding];
+ break;
+ case 'f':
+ options->force = YES;
+ break;
default:
Usage(argc, argv);
exit(0);
@@ -191,8 +332,8 @@ SetupOptions(int argc, const char *argv[], Options *options) {
}
//=============================================================================
-int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+int main(int argc, const char* argv[]) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
Options options;
bzero(&options, sizeof(Options));
@@ -200,5 +341,5 @@ int main (int argc, const char * argv[]) {
Start(&options);
[pool release];
- return options.success ? 0 : 1;
+ return options.result;
}
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj b/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj
index a6a78dc5f3e..1653b388541 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj
+++ b/chromium/third_party/breakpad/breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj
@@ -7,6 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
+ 5B6060BD222716FC0015F0A0 /* HTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B6060BC222716FC0015F0A0 /* HTTPRequest.m */; };
+ 5B6060C02227201B0015F0A0 /* HTTPPutRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B6060BF2227201B0015F0A0 /* HTTPPutRequest.m */; };
+ 5B6060C7222735E50015F0A0 /* HTTPGetRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B6060C6222735E50015F0A0 /* HTTPGetRequest.m */; };
+ 5B6060CA2227374E0015F0A0 /* HTTPSimplePostRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B6060C92227374E0015F0A0 /* HTTPSimplePostRequest.m */; };
+ 5B6060D022273BDA0015F0A0 /* SymbolCollectorClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B6060CF22273BDA0015F0A0 /* SymbolCollectorClient.m */; };
+ 5B97447524D0AA5F000C71F5 /* encoding_util.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B97447424D0AA5F000C71F5 /* encoding_util.m */; };
8B31022C11F0CEBD00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
8DD76F9A0486AA7600D96B5E /* symupload.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* symupload.m */; settings = {ATTRIBUTES = (); }; };
8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
@@ -30,16 +36,28 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 08FB7796FE84155DC02AAC07 /* symupload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = symupload.m; sourceTree = "<group>"; };
+ 08FB7796FE84155DC02AAC07 /* symupload.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = symupload.m; sourceTree = "<group>"; tabWidth = 2; };
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 5B6060BB222716FC0015F0A0 /* HTTPRequest.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = HTTPRequest.h; path = ../../../common/mac/HTTPRequest.h; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060BC222716FC0015F0A0 /* HTTPRequest.m */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; name = HTTPRequest.m; path = ../../../common/mac/HTTPRequest.m; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060BE2227201B0015F0A0 /* HTTPPutRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPPutRequest.h; path = ../../../common/mac/HTTPPutRequest.h; sourceTree = "<group>"; };
+ 5B6060BF2227201B0015F0A0 /* HTTPPutRequest.m */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; name = HTTPPutRequest.m; path = ../../../common/mac/HTTPPutRequest.m; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060C22227303A0015F0A0 /* encoding_util.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = encoding_util.h; path = ../../../common/mac/encoding_util.h; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060C5222735E50015F0A0 /* HTTPGetRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTTPGetRequest.h; path = ../../../common/mac/HTTPGetRequest.h; sourceTree = "<group>"; };
+ 5B6060C6222735E50015F0A0 /* HTTPGetRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTTPGetRequest.m; path = ../../../common/mac/HTTPGetRequest.m; sourceTree = "<group>"; };
+ 5B6060C82227374E0015F0A0 /* HTTPSimplePostRequest.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = HTTPSimplePostRequest.h; path = ../../../common/mac/HTTPSimplePostRequest.h; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060C92227374E0015F0A0 /* HTTPSimplePostRequest.m */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; name = HTTPSimplePostRequest.m; path = ../../../common/mac/HTTPSimplePostRequest.m; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060CE22273BDA0015F0A0 /* SymbolCollectorClient.h */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SymbolCollectorClient.h; path = ../../../common/mac/SymbolCollectorClient.h; sourceTree = "<group>"; tabWidth = 2; };
+ 5B6060CF22273BDA0015F0A0 /* SymbolCollectorClient.m */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; name = SymbolCollectorClient.m; path = ../../../common/mac/SymbolCollectorClient.m; sourceTree = "<group>"; tabWidth = 2; };
+ 5B97447424D0AA5F000C71F5 /* encoding_util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = encoding_util.m; path = ../../../common/mac/encoding_util.m; sourceTree = "<group>"; };
8B31022B11F0CE6900FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
8DD76FA10486AA7600D96B5E /* symupload */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = symupload; sourceTree = BUILT_PRODUCTS_DIR; };
- 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPMultipartUpload.h; path = ../../../common/mac/HTTPMultipartUpload.h; sourceTree = "<group>"; };
- 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPMultipartUpload.m; path = ../../../common/mac/HTTPMultipartUpload.m; sourceTree = "<group>"; };
+ 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = HTTPMultipartUpload.h; path = ../../../common/mac/HTTPMultipartUpload.h; sourceTree = "<group>"; tabWidth = 2; };
+ 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; name = HTTPMultipartUpload.m; path = ../../../common/mac/HTTPMultipartUpload.m; sourceTree = "<group>"; tabWidth = 2; };
9BD835FB0B0544950055103E /* minidump_upload */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidump_upload; sourceTree = BUILT_PRODUCTS_DIR; };
- 9BD836000B0544BA0055103E /* minidump_upload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = minidump_upload.m; sourceTree = "<group>"; };
+ 9BD836000B0544BA0055103E /* minidump_upload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = minidump_upload.m; path = ../../../common/mac/minidump_upload.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -65,6 +83,18 @@
08FB7794FE84155DC02AAC07 /* symupload */ = {
isa = PBXGroup;
children = (
+ 5B6060CE22273BDA0015F0A0 /* SymbolCollectorClient.h */,
+ 5B6060CF22273BDA0015F0A0 /* SymbolCollectorClient.m */,
+ 5B6060C82227374E0015F0A0 /* HTTPSimplePostRequest.h */,
+ 5B6060C92227374E0015F0A0 /* HTTPSimplePostRequest.m */,
+ 5B6060C5222735E50015F0A0 /* HTTPGetRequest.h */,
+ 5B6060C6222735E50015F0A0 /* HTTPGetRequest.m */,
+ 5B6060C22227303A0015F0A0 /* encoding_util.h */,
+ 5B97447424D0AA5F000C71F5 /* encoding_util.m */,
+ 5B6060BE2227201B0015F0A0 /* HTTPPutRequest.h */,
+ 5B6060BF2227201B0015F0A0 /* HTTPPutRequest.m */,
+ 5B6060BB222716FC0015F0A0 /* HTTPRequest.h */,
+ 5B6060BC222716FC0015F0A0 /* HTTPRequest.m */,
8B31022B11F0CE6900FCF3E4 /* Breakpad.xcconfig */,
8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */,
8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */,
@@ -137,9 +167,15 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "symupload" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = en;
hasScannedForEncodings = 1;
+ knownRegions = (
+ en,
+ );
mainGroup = 08FB7794FE84155DC02AAC07 /* symupload */;
projectDirPath = "";
projectRoot = "";
@@ -156,6 +192,12 @@
buildActionMask = 2147483647;
files = (
8DD76F9A0486AA7600D96B5E /* symupload.m in Sources */,
+ 5B6060CA2227374E0015F0A0 /* HTTPSimplePostRequest.m in Sources */,
+ 5B6060D022273BDA0015F0A0 /* SymbolCollectorClient.m in Sources */,
+ 5B6060C7222735E50015F0A0 /* HTTPGetRequest.m in Sources */,
+ 5B6060C02227201B0015F0A0 /* HTTPPutRequest.m in Sources */,
+ 5B6060BD222716FC0015F0A0 /* HTTPRequest.m in Sources */,
+ 5B97447524D0AA5F000C71F5 /* encoding_util.m in Sources */,
9BD8336B0B03E4080055103E /* HTTPMultipartUpload.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/solaris/dump_syms/dump_syms.cc b/chromium/third_party/breakpad/breakpad/src/tools/solaris/dump_syms/dump_syms.cc
index 54cea57e75b..ba396e10af4 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/solaris/dump_syms/dump_syms.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/solaris/dump_syms/dump_syms.cc
@@ -36,13 +36,13 @@
using namespace google_breakpad;
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
if (argc != 2) {
fprintf(stderr, "Usage: %s <binary-with-stab-symbol>\n", argv[0]);
return 1;
}
- const char *binary = argv[1];
+ const char* binary = argv[1];
DumpSymbols dumper;
if (!dumper.WriteSymbolFile(binary, fileno(stdout))) {
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc
index 2b40faeeb5d..102d06fd411 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc
@@ -92,7 +92,7 @@ namespace google_breakpad {
#endif // _MSC_VER >= 1400
bool GUIDOrSignatureIdentifier::InitializeFromString(
- const string &identifier) {
+ const string& identifier) {
type_ = TYPE_NONE;
size_t length = identifier.length();
@@ -128,7 +128,7 @@ bool GUIDOrSignatureIdentifier::InitializeFromString(
#undef SSCANF
MSSymbolServerConverter::MSSymbolServerConverter(
- const string &local_cache, const vector<string> &symbol_servers)
+ const string& local_cache, const vector<string>& symbol_servers)
: symbol_path_(),
fail_dns_(false),
fail_timeout_(false),
@@ -184,7 +184,7 @@ class AutoSymSrv {
}
}
- bool Initialize(HANDLE process, char *path, bool invade_process) {
+ bool Initialize(HANDLE process, char* path, bool invade_process) {
process_ = process;
// TODO(nbilling): Figure out why dbghelp.dll is being loaded from
@@ -240,7 +240,7 @@ class AutoSymSrv {
// are supported by calling Delete().
class AutoDeleter {
public:
- explicit AutoDeleter(const string &path) : path_(path) {}
+ explicit AutoDeleter(const string& path) : path_(path) {}
~AutoDeleter() {
int error;
@@ -270,10 +270,10 @@ class AutoDeleter {
};
MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
- const string &debug_or_code_id,
- const string &version,
- string *file_name) {
+MSSymbolServerConverter::LocateFile(const string& debug_or_code_file,
+ const string& debug_or_code_id,
+ const string& version,
+ string* file_name) {
assert(file_name);
file_name->clear();
@@ -290,7 +290,7 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
HANDLE process = GetCurrentProcess(); // CloseHandle is not needed.
AutoSymSrv symsrv;
if (!symsrv.Initialize(process,
- const_cast<char *>(symbol_path_.c_str()),
+ const_cast<char*>(symbol_path_.c_str()),
false)) {
fprintf(stderr, "LocateFile: SymInitialize: error %lu for %s %s %s\n",
GetLastError(),
@@ -326,8 +326,8 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
char path[MAX_PATH];
if (!SymFindFileInPath(
process, NULL,
- const_cast<char *>(debug_or_code_file.c_str()),
- const_cast<void *>(identifier.guid_or_signature_pointer()),
+ const_cast<char*>(debug_or_code_file.c_str()),
+ const_cast<void*>(identifier.guid_or_signature_pointer()),
identifier.age(), 0,
identifier.type() == GUIDOrSignatureIdentifier::TYPE_GUID ?
SSRVOPT_GUIDPTR : SSRVOPT_DWORDPTR,
@@ -393,15 +393,15 @@ MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocatePEFile(const MissingSymbolInfo &missing,
- string *pe_file) {
+MSSymbolServerConverter::LocatePEFile(const MissingSymbolInfo& missing,
+ string* pe_file) {
return LocateFile(missing.code_file, missing.code_identifier,
missing.version, pe_file);
}
MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocateSymbolFile(const MissingSymbolInfo &missing,
- string *symbol_file) {
+MSSymbolServerConverter::LocateSymbolFile(const MissingSymbolInfo& missing,
+ string* symbol_file) {
return LocateFile(missing.debug_file, missing.debug_identifier,
missing.version, symbol_file);
}
@@ -412,13 +412,13 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process,
ULONG action,
ULONG64 data,
ULONG64 context) {
- MSSymbolServerConverter *self =
- reinterpret_cast<MSSymbolServerConverter *>(context);
+ MSSymbolServerConverter* self =
+ reinterpret_cast<MSSymbolServerConverter*>(context);
switch (action) {
case CBA_EVENT: {
- IMAGEHLP_CBA_EVENT *cba_event =
- reinterpret_cast<IMAGEHLP_CBA_EVENT *>(data);
+ IMAGEHLP_CBA_EVENT* cba_event =
+ reinterpret_cast<IMAGEHLP_CBA_EVENT*>(data);
// Put the string into a string object to be able to use string::find
// for substring matching. This is important because the not-found
@@ -429,8 +429,8 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process,
// desc_action maps strings (in desc) to boolean pointers that are to
// be set to true if the string matches.
struct desc_action {
- const char *desc; // The substring to match.
- bool *action; // On match, this pointer will be set to true.
+ const char* desc; // The substring to match.
+ bool* action; // On match, this pointer will be set to true.
};
static const desc_action desc_actions[] = {
@@ -478,7 +478,7 @@ BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process,
// static
BOOL CALLBACK MSSymbolServerConverter::SymFindFileInPathCallback(
- const char *filename, void *context) {
+ const char* filename, void* context) {
// FALSE ends the search, indicating that the located symbol file is
// satisfactory.
return FALSE;
@@ -486,12 +486,12 @@ BOOL CALLBACK MSSymbolServerConverter::SymFindFileInPathCallback(
MSSymbolServerConverter::LocateResult
MSSymbolServerConverter::LocateAndConvertSymbolFile(
- const MissingSymbolInfo &missing,
+ const MissingSymbolInfo& missing,
bool keep_symbol_file,
bool keep_pe_file,
- string *converted_symbol_file,
- string *symbol_file,
- string *out_pe_file) {
+ string* converted_symbol_file,
+ string* symbol_file,
+ string* out_pe_file) {
assert(converted_symbol_file);
converted_symbol_file->clear();
if (symbol_file) {
@@ -580,7 +580,7 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
*converted_symbol_file = pdb_file.substr(0, pdb_file.length() - 4) + ".sym";
- FILE *converted_output = NULL;
+ 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"))
@@ -634,10 +634,10 @@ MSSymbolServerConverter::LocateAndConvertSymbolFile(
MSSymbolServerConverter::LocateResult
MSSymbolServerConverter::LocateAndConvertPEFile(
- const MissingSymbolInfo &missing,
+ const MissingSymbolInfo& missing,
bool keep_pe_file,
- string *converted_symbol_file,
- string *out_pe_file) {
+ string* converted_symbol_file,
+ string* out_pe_file) {
assert(converted_symbol_file);
converted_symbol_file->clear();
@@ -676,7 +676,7 @@ MSSymbolServerConverter::LocateAndConvertPEFile(
*converted_symbol_file = pe_file.substr(0, pe_file.length() - 4) + ".sym";
- FILE *converted_output = NULL;
+ 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"))
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.h b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.h
index 401f7c34431..40d65d52a7e 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.h
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter/ms_symbol_server_converter.h
@@ -101,13 +101,13 @@ class GUIDOrSignatureIdentifier {
// component fields: either a GUID and age, or signature and age. If
// successful, sets the relevant fields in the object, including the type
// field, and returns true. On error, returns false.
- bool InitializeFromString(const string &identifier);
+ bool InitializeFromString(const string& identifier);
GUIDOrSignatureType type() const { return type_; }
GUID guid() const { return guid_; }
DWORD signature() const { return signature_; }
int age() const { return age_; }
- const void *guid_or_signature_pointer() const { return &guid_; }
+ const void* guid_or_signature_pointer() const { return &guid_; }
private:
GUIDOrSignatureType type_;
@@ -141,23 +141,23 @@ class MSSymbolServerConverter {
// store to try. The vector must contain at least one string. None of the
// strings passed to this constructor may contain asterisk ('*') or semicolon
// (';') characters, as the symbol engine uses these characters as separators.
- MSSymbolServerConverter(const string &local_cache,
- const vector<string> &symbol_servers);
+ MSSymbolServerConverter(const string& local_cache,
+ const vector<string>& symbol_servers);
// Locates the PE file (DLL or EXE) specified by the identifying information
// in |missing|, by checking the symbol stores identified when the object
// was created. When returning LOCATE_SUCCESS, pe_file is set to
// the pathname of the decompressed PE file as it is stored in the
// local cache.
- LocateResult LocatePEFile(const MissingSymbolInfo &missing, string *pe_file);
+ LocateResult LocatePEFile(const MissingSymbolInfo& missing, string* pe_file);
// Locates the symbol file specified by the identifying information in
// |missing|, by checking the symbol stores identified when the object
// was created. When returning LOCATE_SUCCESS, symbol_file is set to
// the pathname of the decompressed symbol file as it is stored in the
// local cache.
- LocateResult LocateSymbolFile(const MissingSymbolInfo &missing,
- string *symbol_file);
+ LocateResult LocateSymbolFile(const MissingSymbolInfo& missing,
+ string* symbol_file);
// Calls LocateSymbolFile and converts the returned symbol file to the
// dumped-symbol format, storing it adjacent to the symbol file. The
@@ -170,12 +170,12 @@ class MSSymbolServerConverter {
// is desired, set |keep_symbol_file| and |keep_pe_file| to false to indicate
// that the original symbol file (pdb) and executable file (exe, dll) should
// be deleted after conversion.
- LocateResult LocateAndConvertSymbolFile(const MissingSymbolInfo &missing,
+ LocateResult LocateAndConvertSymbolFile(const MissingSymbolInfo& missing,
bool keep_symbol_file,
bool keep_pe_file,
- string *converted_symbol_file,
- string *symbol_file,
- string *pe_file);
+ string* converted_symbol_file,
+ 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
@@ -188,10 +188,10 @@ class MSSymbolServerConverter {
// 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);
+ 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
@@ -199,9 +199,9 @@ class MSSymbolServerConverter {
// the symbol stores identified when the object was created. When
// returning LOCATE_SUCCESS, file_name is set to the pathname of the
// decompressed PDB or PE file file as it is stored in the local cache.
- LocateResult LocateFile(const string &debug_or_code_file,
- const string &debug_or_code_id,
- const string &version, string *file_name);
+ LocateResult LocateFile(const string& debug_or_code_file,
+ const string& debug_or_code_id,
+ const string& version, string* file_name);
// Called by various SymSrv functions to report status as progress is made
// and to allow the callback to influence processing. Messages sent to this
@@ -215,8 +215,8 @@ class MSSymbolServerConverter {
// SymFindFileInPath actually seems to accept NULL for a callback function
// and behave properly for our needs in that case, but the documentation
// doesn't mention it, so this little callback is provided.
- static BOOL CALLBACK SymFindFileInPathCallback(const char *filename,
- void *context);
+ static BOOL CALLBACK SymFindFileInPathCallback(const char* filename,
+ void* context);
// The search path used by SymSrv, built based on the arguments to the
// constructor.
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/converter.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/converter.cc
index ecf7eb4a800..a97bc7674f7 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/converter.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/converter.cc
@@ -62,14 +62,14 @@ 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/";
+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, ...) {
+static int FprintfFlush(FILE* file, const char* format, ...) {
va_list arguments;
va_start(arguments, format);
int retval = vfprintf(file, format, arguments);
@@ -86,11 +86,11 @@ static string CurrentDateAndTime() {
// localtime_s is safer but is only available in MSVC8. Use localtime
// in earlier environments.
- struct tm *time_pointer;
+ 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) {
+ time_pointer =& time_struct;
+ if (localtime_s(time_pointer,& current_time) != 0) {
return kUnknownDateAndTime;
}
#else // _MSC_VER >= 1400
@@ -111,12 +111,12 @@ static string CurrentDateAndTime() {
// 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) {
+static bool ParseMissingString(const string& missing_string,
+ MissingSymbolInfo* missing_info) {
assert(missing_info);
vector<string> tokens;
- Tokenizer::Tokenize(kMissingStringDelimiters, missing_string, &tokens);
+ Tokenizer::Tokenize(kMissingStringDelimiters, missing_string,& tokens);
if (tokens.size() != 5) {
return false;
}
@@ -133,8 +133,8 @@ static bool ParseMissingString(const string &missing_string,
// 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) {
+static bool StringMapToWStringMap(const map<string, string>& smap,
+ map<wstring, wstring>* wsmap) {
assert(wsmap);
wsmap->clear();
@@ -142,7 +142,7 @@ static bool StringMapToWStringMap(const map<string, string> &smap,
iterator != smap.end();
++iterator) {
wstring key;
- if (!WindowsStringUtils::safe_mbstowcs(iterator->first, &key)) {
+ if (!WindowsStringUtils::safe_mbstowcs(iterator->first,& key)) {
FprintfFlush(stderr,
"StringMapToWStringMap: safe_mbstowcs failed for key %s\n",
iterator->first.c_str());
@@ -150,7 +150,7 @@ static bool StringMapToWStringMap(const map<string, string> &smap,
}
wstring value;
- if (!WindowsStringUtils::safe_mbstowcs(iterator->second, &value)) {
+ if (!WindowsStringUtils::safe_mbstowcs(iterator->second,& value)) {
FprintfFlush(stderr, "StringMapToWStringMap: safe_mbstowcs failed "
"for value %s\n",
iterator->second.c_str());
@@ -166,8 +166,8 @@ static bool StringMapToWStringMap(const map<string, string> &smap,
// 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) {
+static bool MissingSymbolInfoToParameters(const MissingSymbolInfo& missing_info,
+ map<wstring, wstring>* wparameters) {
assert(wparameters);
map<string, string> parameters;
@@ -175,25 +175,25 @@ static bool MissingSymbolInfoToParameters(const MissingSymbolInfo &missing_info,
// Indicate the params are encoded.
parameters["encoded"] = "true"; // The string value here does not matter.
- WebSafeBase64Escape(missing_info.code_file, &encoded_param);
+ WebSafeBase64Escape(missing_info.code_file,& encoded_param);
parameters["code_file"] = encoded_param;
- WebSafeBase64Escape(missing_info.code_identifier, &encoded_param);
+ WebSafeBase64Escape(missing_info.code_identifier,& encoded_param);
parameters["code_identifier"] = encoded_param;
- WebSafeBase64Escape(missing_info.debug_file, &encoded_param);
+ WebSafeBase64Escape(missing_info.debug_file,& encoded_param);
parameters["debug_file"] = encoded_param;
- WebSafeBase64Escape(missing_info.debug_identifier, &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);
+ WebSafeBase64Escape(missing_info.version,& encoded_param);
parameters["version"] = encoded_param;
}
- WebSafeBase64Escape("WinSymConv", &encoded_param);
+ WebSafeBase64Escape("WinSymConv",& encoded_param);
parameters["product"] = encoded_param;
if (!StringMapToWStringMap(parameters, wparameters)) {
@@ -207,18 +207,18 @@ static bool MissingSymbolInfoToParameters(const MissingSymbolInfo &missing_info,
// 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) {
+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)) {
+ 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)) {
+ if (!WindowsStringUtils::safe_mbstowcs(converted_file,& converted_file_w)) {
FprintfFlush(stderr, "UploadSymbolFile: safe_mbstowcs failed for %s\n",
converted_file.c_str());
return false;
@@ -245,18 +245,18 @@ static bool UploadSymbolFile(const wstring &upload_symbol_url,
// |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) {
+static bool SendFetchFailedPing(const wstring& fetch_symbol_failure_url,
+ const MissingSymbolInfo& missing_info) {
map<wstring, wstring> parameters;
- if (!MissingSymbolInfoToParameters(missing_info, &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,
+ & parameters,
+ & content,
NULL)) {
FprintfFlush(stderr, "SendFetchFailedPing: HTTPDownload::Download failed "
"for %s %s %s\n",
@@ -275,7 +275,7 @@ static bool SendFetchFailedPing(const wstring &fetch_symbol_failure_url,
// 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,
+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.
@@ -352,8 +352,8 @@ struct ConverterOptions {
// 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) {
+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(),
@@ -402,7 +402,7 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo &missing_info,
located = converter.LocateAndConvertSymbolFile(missing_info,
false, // keep_symbol_file
false, // keep_pe_file
- &converted_file,
+ & converted_file,
NULL, // symbol_file
NULL); // pe_file
switch (located) {
@@ -476,7 +476,7 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo &missing_info,
missing_info,
false, // keep_symbol_file
false, // keep_pe_file
- &converted_file,
+ & converted_file,
NULL, // symbol_file
NULL); // pe_file
} else {
@@ -561,9 +561,9 @@ static void ConvertMissingSymbolFile(const MissingSymbolInfo &missing_info,
// Reads the contents of file |file_name| and populates |contents|.
// Returns true on success.
-static bool ReadFile(string file_name, string *contents) {
+static bool ReadFile(string file_name, string* contents) {
char buffer[1024 * 8];
- FILE *fp = fopen(file_name.c_str(), "rt");
+ FILE* fp = fopen(file_name.c_str(), "rt");
if (!fp) {
return false;
}
@@ -578,7 +578,7 @@ static bool ReadFile(string file_name, string *contents) {
// 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) {
+static bool ConvertMissingSymbolsList(const ConverterOptions& options) {
// Set param to indicate requesting for encoded response.
map<wstring, wstring> parameters;
parameters[L"product"] = L"WinSymConv";
@@ -586,17 +586,17 @@ static bool ConvertMissingSymbolsList(const ConverterOptions &options) {
// Get the missing symbol list.
string missing_symbol_list;
if (!options.missing_symbols_file.empty()) {
- if (!ReadFile(options.missing_symbols_file, &missing_symbol_list)) {
+ if (!ReadFile(options.missing_symbols_file,& missing_symbol_list)) {
return false;
}
- } else if (!HTTPDownload::Download(options.missing_symbols_url, &parameters,
- &missing_symbol_list, NULL)) {
+ } 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);
+ 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.
@@ -605,14 +605,14 @@ static bool ConvertMissingSymbolsList(const ConverterOptions &options) {
iterator != missing_symbol_lines.end();
++iterator) {
// Decode symbol line.
- const string &encoded_line = *iterator;
+ const string& encoded_line = *iterator;
// Skip lines that are blank.
if (encoded_line.empty()) {
continue;
}
string line;
- if (!WebSafeBase64Unescape(encoded_line, &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.
@@ -623,7 +623,7 @@ static bool ConvertMissingSymbolsList(const ConverterOptions &options) {
// Turn each element into a MissingSymbolInfo structure.
MissingSymbolInfo missing_info;
- if (!ParseMissingString(line, &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());
@@ -647,7 +647,7 @@ static bool ConvertMissingSymbolsList(const ConverterOptions &options) {
// 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) {
+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"
@@ -670,7 +670,7 @@ static int usage(const char *program_name) {
// "Internal" servers consist only of those whose names start with
// the literal string "\\filer\".
-static bool IsInternalServer(const string &server_name) {
+static bool IsInternalServer(const string& server_name) {
if (server_name.find("\\\\filer\\") == 0) {
return true;
}
@@ -679,9 +679,9 @@ static bool IsInternalServer(const string &server_name) {
// 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) {
+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 {
@@ -691,7 +691,7 @@ static void AddServer(const string &server_name,
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
string time_string = CurrentDateAndTime();
FprintfFlush(stdout, "converter: %s: starting\n", time_string.c_str());
@@ -710,12 +710,12 @@ int main(int argc, char **argv) {
string value = argv[argi + 1];
if (option == "-f") {
- AddServer(value, &options.full_internal_msss_servers,
- &options.full_external_msss_servers);
+ 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);
+ 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()) {
@@ -724,14 +724,14 @@ int main(int argc, char **argv) {
options.local_cache_path = value;
} else if (option == "-s") {
if (!WindowsStringUtils::safe_mbstowcs(value,
- &options.upload_symbols_url)) {
+ & 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)) {
+ & options.missing_symbols_url)) {
FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n",
value.c_str());
return 1;
@@ -744,7 +744,7 @@ int main(int argc, char **argv) {
} else if (option == "-t") {
if (!WindowsStringUtils::safe_mbstowcs(
value,
- &options.fetch_symbol_failure_url)) {
+ & options.fetch_symbol_failure_url)) {
FprintfFlush(stderr, "main: safe_mbstowcs failed for %s\n",
value.c_str());
return 1;
@@ -768,8 +768,8 @@ int main(int argc, char **argv) {
// 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);
+ AddServer(kNoExeMSSSServer,& options.no_exe_internal_msss_servers,
+ & options.no_exe_external_msss_servers);
}
if (options.local_cache_path.empty()) {
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.cc
index 127fbd5ad7a..0910bedcd86 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.cc
@@ -83,11 +83,11 @@ class AutoPtr {
// 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) {
+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;
+ const wstring& key = iterator->first;
if (key.empty()) {
// Disallow empty parameter names.
return false;
@@ -99,7 +99,7 @@ static bool CheckParameters(const map<wstring, wstring> *parameters) {
}
}
- const wstring &value = iterator->second;
+ 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) {
@@ -141,8 +141,8 @@ HttpClient* HTTPDownload::CreateHttpClient(const wchar_t* url) {
}
// static
-bool HTTPDownload::Download(const wstring &url,
- const map<wstring, wstring> *parameters,
+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()));
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.h b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.h
index 25ea1ed6750..d6583517bb5 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.h
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/http_download.h
@@ -50,8 +50,8 @@ class HTTPDownload {
// 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,
+ static bool Download(const wstring& url,
+ const map<wstring, wstring>* parameters,
string *content, int *status_code);
private:
static HttpClient* CreateHttpClient(const wchar_t*);
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.cc
index 7531300cd00..df6da44f9ee 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.cc
@@ -33,8 +33,8 @@
namespace crash {
// static
-void Tokenizer::Tokenize(const string &delimiters, const string &input,
- vector<string> *output) {
+void Tokenizer::Tokenize(const string& delimiters, const string& input,
+ vector<string>* output) {
assert(output);
output->clear();
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.h b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.h
index a258d91a9ba..29f02c848b6 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.h
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/tokenizer.h
@@ -42,8 +42,8 @@ class Tokenizer {
// 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);
+ static void Tokenize(const string& delimiters, const string& input,
+ vector<string>* output);
};
} // namespace crash
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/winhttp_client.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/winhttp_client.cc
index 04b84c71df2..cd468638cb1 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/winhttp_client.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/winhttp_client.cc
@@ -197,7 +197,7 @@ bool WinHttpClient::GetHttpStatusCode(HttpHandle request_handle,
if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle),
WINHTTP_QUERY_STATUS_CODE,
WINHTTP_HEADER_NAME_BY_INDEX,
- static_cast<void *>(&http_status_string),
+ static_cast<void*>(&http_status_string),
&http_status_string_size, 0)) {
return false;
}
@@ -216,7 +216,7 @@ bool WinHttpClient::GetContentLength(HttpHandle request_handle,
if (!::WinHttpQueryHeaders(ToHINTERNET(request_handle),
WINHTTP_QUERY_CONTENT_LENGTH,
WINHTTP_HEADER_NAME_BY_INDEX,
- static_cast<void *>(&content_length_string),
+ static_cast<void*>(&content_length_string),
&content_length_string_size, 0)) {
*content_length = kUnknownContentLength;
} else {
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/wininet_client.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/wininet_client.cc
index 99f9f483193..c2ec7050058 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/wininet_client.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/converter_exe/wininet_client.cc
@@ -196,7 +196,7 @@ bool WinInetClient::GetHttpStatusCode(HttpHandle request_handle,
DWORD http_status_string_size = sizeof(http_status_string);
if (!::HttpQueryInfo(ToHINTERNET(request_handle),
HTTP_QUERY_STATUS_CODE,
- static_cast<void *>(&http_status_string),
+ static_cast<void*>(&http_status_string),
&http_status_string_size,
0)) {
return false;
@@ -215,7 +215,7 @@ bool WinInetClient::GetContentLength(HttpHandle request_handle,
DWORD content_length_string_size = sizeof(content_length_string);
if (!::HttpQueryInfo(ToHINTERNET(request_handle),
HTTP_QUERY_CONTENT_LENGTH,
- static_cast<void *>(&content_length_string),
+ static_cast<void*>(&content_length_string),
&content_length_string_size,
0)) {
*content_length = kUnknownContentLength;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms.cc
index 5b7d1777538..1b1797dc2a6 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms.cc
@@ -43,7 +43,7 @@ using google_breakpad::PDBSourceLineWriter;
using google_breakpad::PESourceLineWriter;
using std::unique_ptr;
-int wmain(int argc, wchar_t **argv) {
+int wmain(int argc, wchar_t** argv) {
bool success;
if (argc == 2) {
PDBSourceLineWriter pdb_writer;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc
index 48011eec19b..6e2abe2d51f 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc
@@ -166,7 +166,7 @@ void GetFileContents(const std::wstring& path, std::string* content) {
}
}
-class DumpSymsRegressionTest : public testing::TestWithParam<const wchar_t *> {
+class DumpSymsRegressionTest : public testing::TestWithParam<const wchar_t*> {
public:
virtual void SetUp() {
std::wstring self_dir;
@@ -181,7 +181,7 @@ class DumpSymsRegressionTest : public testing::TestWithParam<const wchar_t *> {
std::wstring testdata_dir;
};
-class DumpSymsPEOnlyRegressionTest : public testing::TestWithParam<const wchar_t *> {
+class DumpSymsPEOnlyRegressionTest : public testing::TestWithParam<const wchar_t*> {
public:
virtual void SetUp() {
std::wstring self_dir;
diff --git a/chromium/third_party/breakpad/breakpad/src/tools/windows/symupload/symupload.cc b/chromium/third_party/breakpad/breakpad/src/tools/windows/symupload/symupload.cc
index 7e3029326d5..e6fa126fac4 100644
--- a/chromium/third_party/breakpad/breakpad/src/tools/windows/symupload/symupload.cc
+++ b/chromium/third_party/breakpad/breakpad/src/tools/windows/symupload/symupload.cc
@@ -73,7 +73,7 @@ using google_breakpad::WindowsStringUtils;
// Extracts the file version information for the given filename,
// as a string, for example, "1.2.3.4". Returns true on success.
-static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
+static bool GetFileVersionString(const wchar_t* filename, wstring* version) {
DWORD handle;
DWORD version_size = GetFileVersionInfoSize(filename, &handle);
if (version_size < sizeof(VS_FIXEDFILEINFO)) {
@@ -85,7 +85,7 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
return false;
}
- void *file_info_buffer = NULL;
+ void* file_info_buffer = NULL;
unsigned int file_info_length;
if (!VerQueryValue(&version_info[0], L"\\",
&file_info_buffer, &file_info_length)) {
@@ -95,7 +95,7 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
// The maximum value of each version component is 65535 (0xffff),
// so the max length is 24, including the terminating null.
wchar_t ver_string[24];
- VS_FIXEDFILEINFO *file_info =
+ VS_FIXEDFILEINFO* file_info =
reinterpret_cast<VS_FIXEDFILEINFO*>(file_info_buffer);
swprintf(ver_string, sizeof(ver_string) / sizeof(ver_string[0]),
L"%d.%d.%d.%d",
@@ -114,9 +114,9 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
// Creates a new temporary file and writes the symbol data from the given
// exe/dll file to it. Returns the path to the temp file in temp_file_path
// and information about the pdb in pdb_info.
-static bool DumpSymbolsToTempFile(const wchar_t *file,
- wstring *temp_file_path,
- PDBModuleInfo *pdb_info) {
+static bool DumpSymbolsToTempFile(const wchar_t* file,
+ wstring* temp_file_path,
+ PDBModuleInfo* pdb_info) {
google_breakpad::PDBSourceLineWriter writer;
// Use EXE_FILE to get information out of the exe/dll in addition to the
// pdb. The name and version number of the exe/dll are of value, and
@@ -135,7 +135,7 @@ static bool DumpSymbolsToTempFile(const wchar_t *file,
return false;
}
- FILE *temp_file = NULL;
+ FILE* temp_file = NULL;
#if _MSC_VER >= 1400 // MSVC 2005/8
if (_wfopen_s(&temp_file, temp_filename, L"w") != 0)
#else // _MSC_VER >= 1400
@@ -270,9 +270,9 @@ __declspec(noreturn) void printUsageAndExit() {
exit(0);
}
-int wmain(int argc, wchar_t *argv[]) {
- const wchar_t *module;
- const wchar_t *product = nullptr;
+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;