From f87aa69d2c2f80c7577a4a6b81bb0ba810c4cb5d Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Mon, 16 Aug 2010 15:05:08 -0400 Subject: [PATCH] bug 559228 - Update Breakpad to r652 --HG-- extra : rebase_source : bec760bf86aa27731fcced3bfea3dcfaf5213293 --- .../google-breakpad/.hg_archival.txt | 5 + .../google-breakpad/.hgsvnexternals | 7 + toolkit/crashreporter/google-breakpad/README | 41 + .../client/linux/handler/exception_handler.cc | 10 +- .../linux/minidump_writer/linux_dumper.cc | 36 +- .../minidump_extension_linux.h | 74 + .../linux/minidump_writer/minidump_writer.cc | 276 +++- .../mac/Breakpad.xcodeproj/project.pbxproj | 1188 +++++++++++------ .../src/client/mac/Framework/Breakpad.h | 9 +- .../src/client/mac/Framework/Breakpad.mm | 119 +- .../client/mac/Framework/OnDemandServer.mm | 2 +- .../client/mac/crash_generation/Inspector.mm | 16 +- .../client/mac/crash_generation/client_info.h | 47 + .../crash_generation_client.cc | 73 + .../crash_generation_client.h | 65 + .../crash_generation_server.cc | 160 +++ .../crash_generation_server.h | 139 ++ .../client/mac/handler/breakpad_nlist_64.cc | 22 +- .../src/client/mac/handler/dynamic_images.cc | 20 +- .../src/client/mac/handler/dynamic_images.h | 24 +- .../client/mac/handler/exception_handler.cc | 59 +- .../client/mac/handler/exception_handler.h | 24 +- .../mac/handler/exception_handler_test.cc | 99 -- .../client/mac/handler/minidump_generator.cc | 53 +- .../minidump_test.xcodeproj/project.pbxproj | 237 +--- .../mac/handler/protected_memory_allocator.cc | 2 +- .../mac/handler/protected_memory_allocator.h | 4 +- .../client/mac/sender/crash_report_sender.h | 5 +- .../client/mac/sender/crash_report_sender.m | 67 +- .../mac/sender/da.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/da.lproj/Localizable.strings | Bin 0 -> 2428 bytes .../mac/sender/de.lproj/InfoPlist.strings | Bin 0 -> 192 bytes .../mac/sender/de.lproj/Localizable.strings | Bin 0 -> 2746 bytes .../mac/sender/es.lproj/InfoPlist.strings | Bin 0 -> 184 bytes .../mac/sender/es.lproj/Localizable.strings | Bin 0 -> 2578 bytes .../mac/sender/fr.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/fr.lproj/Localizable.strings | Bin 0 -> 2694 bytes .../mac/sender/it.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/it.lproj/Localizable.strings | Bin 0 -> 2590 bytes .../mac/sender/ja.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/ja.lproj/Localizable.strings | Bin 0 -> 1792 bytes .../mac/sender/nl.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/nl.lproj/Localizable.strings | Bin 0 -> 2546 bytes .../mac/sender/no.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/no.lproj/Localizable.strings | Bin 0 -> 2484 bytes .../mac/sender/sl.lproj/InfoPlist.strings | Bin 0 -> 184 bytes .../mac/sender/sl.lproj/Localizable.strings | Bin 0 -> 2632 bytes .../mac/sender/sv.lproj/InfoPlist.strings | Bin 0 -> 156 bytes .../mac/sender/sv.lproj/Localizable.strings | Bin 0 -> 2588 bytes .../mac/sender/tr.lproj/InfoPlist.strings | Bin 0 -> 168 bytes .../mac/sender/tr.lproj/Localizable.strings | Bin 0 -> 2430 bytes .../src/client/mac/testapp/Controller.m | 9 +- .../mac/testapp/English.lproj/MainMenu.xib | 994 ++++++++++++-- .../src/client/mac/testapp/TestClass.mm | 2 +- .../mac/tests/SimpleStringDictionaryTest.h | 2 +- .../src/client/mac/tests/auto_tempdir.h | 72 + .../mac/tests/crash_generation_server_test.cc | 223 ++++ .../mac/tests/exception_handler_test.cc | 198 +++ .../src/client/minidump_file_writer-inl.h | 21 +- .../src/client/minidump_file_writer.cc | 25 +- .../src/client/minidump_file_writer.h | 4 +- .../client/minidump_file_writer_unittest.cc | 11 +- .../src/common/dwarf/bytereader.cc | 2 +- .../src/common/dwarf/bytereader.h | 2 +- .../src/common/dwarf/dwarf2reader.cc | 34 +- .../src/common/dwarf/dwarf2reader.h | 2 +- .../src/common/dwarf/line_state_machine.h | 2 +- .../src/common/dwarf_cfi_to_module.cc | 19 +- .../src/common/dwarf_cfi_to_module.h | 23 +- .../src/common/dwarf_cu_to_module.cc | 27 +- .../src/common/linux/dump_symbols.cc | 443 ++++-- .../src/common/linux/dump_symbols.h | 5 +- .../google-breakpad/src/common/linux/memory.h | 18 + .../src/common/mac/Breakpad.xcconfig | 57 + .../src/common/mac/BreakpadDebug.xcconfig | 32 + .../src/common/mac/BreakpadRelease.xcconfig | 33 + .../src/common/mac/HTTPMultipartUpload.m | 8 +- .../google-breakpad/src/common/mac/MachIPC.h | 13 +- .../google-breakpad/src/common/mac/MachIPC.mm | 39 +- .../src/common/mac/dump_syms.h | 12 +- .../src/common/mac/dump_syms.mm | 23 +- .../src/common/mac/macho_id.cc | 15 +- .../google-breakpad/src/common/mac/macho_id.h | 2 +- .../src/common/mac/macho_reader.cc | 2 +- .../src/common/mac/macho_reader_unittest.cc | 4 +- .../src/common/mac/macho_walker.cc | 16 +- .../src/common/mac/macho_walker.h | 4 + .../src/common/mac/scoped_task_suspend-inl.h | 56 + .../src/common/mac/string_utilities.cc | 2 +- .../google-breakpad/src/common/module.cc | 21 +- .../google-breakpad/src/common/module.h | 26 +- .../src/common/module_unittest.cc | 77 +- .../src/common/stabs_to_module.cc | 19 +- .../src/common/stabs_to_module_unittest.cc | 34 +- .../src/common/string_conversion.cc | 7 +- .../src/common/test_assembler.cc | 2 +- .../src/common/test_assembler_unittest.cc | 8 +- .../src/processor/minidump_unittest.cc | 4 +- .../processor/stackwalker_amd64_unittest.cc | 6 +- .../src/processor/stackwalker_arm_unittest.cc | 6 +- .../src/processor/stackwalker_sparc.cc | 2 +- .../src/processor/stackwalker_x86_unittest.cc | 6 +- .../src/processor/synth_minidump.cc | 14 +- .../src/processor/synth_minidump.h | 40 +- .../src/processor/synth_minidump_unittest.cc | 6 +- .../src/tools/linux/dump_syms/dump_syms.cc | 12 +- .../tools/linux/md2core/minidump-2-core.cc | 733 +++++++++- .../crash_report.xcodeproj/project.pbxproj | 164 +-- .../crash_report/on_demand_symbol_supplier.mm | 40 +- .../dump_syms.xcodeproj/project.pbxproj | 499 +++---- .../src/tools/mac/dump_syms/macho_dump.cc | 3 +- .../src/tools/mac/symupload/minidump_upload.m | 8 +- .../src/tools/mac/symupload/symupload.m | 6 +- .../symupload.xcodeproj/project.pbxproj | 85 +- 114 files changed, 5337 insertions(+), 1830 deletions(-) create mode 100644 toolkit/crashreporter/google-breakpad/.hg_archival.txt create mode 100644 toolkit/crashreporter/google-breakpad/.hgsvnexternals create mode 100644 toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_extension_linux.h create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h delete mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler_test.cc create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.strings create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/tests/auto_tempdir.h create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc create mode 100644 toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc create mode 100644 toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig create mode 100644 toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig create mode 100644 toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig create mode 100644 toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h diff --git a/toolkit/crashreporter/google-breakpad/.hg_archival.txt b/toolkit/crashreporter/google-breakpad/.hg_archival.txt new file mode 100644 index 00000000000..1f5c2a88d26 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/.hg_archival.txt @@ -0,0 +1,5 @@ +repo: aa80aeafa44f5c17c84e1dac5a7119a6d1ef4341 +node: 2645d42a92c4144ec095d774a32d2fcaec1afa0b +branch: default +latesttag: null +latesttagdistance: 581 diff --git a/toolkit/crashreporter/google-breakpad/.hgsvnexternals b/toolkit/crashreporter/google-breakpad/.hgsvnexternals new file mode 100644 index 00000000000..d4d9953d3d8 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/.hgsvnexternals @@ -0,0 +1,7 @@ +[.] + src/testing -r175 http://googlemock.googlecode.com/svn/trunk/ + src/tools/gyp -r762 http://gyp.googlecode.com/svn/trunk +[src/third_party/glog] + glog http://google-glog.googlecode.com/svn/trunk +[src/third_party/protobuf] + protobuf http://protobuf.googlecode.com/svn/trunk diff --git a/toolkit/crashreporter/google-breakpad/README b/toolkit/crashreporter/google-breakpad/README index 93b8df08bb6..3bccd4be8d8 100644 --- a/toolkit/crashreporter/google-breakpad/README +++ b/toolkit/crashreporter/google-breakpad/README @@ -1,2 +1,43 @@ Breakpad is a set of client and server components which implement a crash-reporting system. + + +----- +Getting started in 32-bit mode (from trunk) +Configure: CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ./configure + Build: make + Test: make check + Install: make install + +If you need to reconfigure your build be sure to run "make distclean" first. + + +----- +To request change review: +0. Get access to a read-write copy of source. + Owners at http://code.google.com/p/google-breakpad/ are able to grant + this access. + +1. Check out a read-write copy of source using instructions at + http://code.google.com/p/google-breakpad/source/checkout + +2. Make changes. Build and test your changes. + For core code like processor use methods above. + For linux/mac/windows, there are test targets in each project file. + +3. Download http://codereview.appspot.com/static/upload.py + +4. Run upload.py from the 'src' directory: + upload.py --server=breakpad.appspot.com + + You will be prompted for credential and a description. + +5. At http://breakpad.appspot.com you'll find your issue listed; click on it, + and select Publish+Mail, and enter in the code reviewer and CC + google-breakpad-dev@googlegroups.com + +6. When applying code review feedback, specify the '-i' option when running + upload.py again and pass the issue number so it updates the existing issue, + rather than creating a new one. + Be sure to rerun upload.py from the same directory as you did for previous + uploads to allow for proper diff calculations. diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc index 77a67f8ee4b..3b8a5c6fbbb 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -268,7 +269,10 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { // crashed. The default action for all the signals which we catch is Core, so // this is the end of us. signal(sig, SIG_DFL); - tgkill(getpid(), sys_gettid(), sig); + + // TODO(markus): mask signal and return to caller + tgkill(getpid(), syscall(__NR_gettid), sig); + _exit(1); // not reached. } @@ -296,7 +300,7 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { return false; // Allow ourselves to be dumped. - sys_prctl(PR_SET_DUMPABLE, 1); + prctl(PR_SET_DUMPABLE, 1); CrashContext context; memcpy(&context.siginfo, info, sizeof(siginfo_t)); memcpy(&context.context, uc, sizeof(struct ucontext)); @@ -309,7 +313,7 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { sizeof(context.float_state)); } #endif - context.tid = sys_gettid(); + context.tid = syscall(__NR_gettid); if (crash_handler_ != NULL) { if (crash_handler_(&context, sizeof(context), callback_context_)) { diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc index fdc52074f8d..a98fcaa7ea6 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc @@ -76,6 +76,26 @@ bool AttachThread(pid_t pid) { return false; } } +#if defined(__i386) || defined(__x86_64) + // On x86, the stack pointer is NULL or -1, when executing trusted code in + // the seccomp sandbox. Not only does this cause difficulties down the line + // when trying to dump the thread's stack, it also results in the minidumps + // containing information about the trusted threads. This information is + // generally completely meaningless and just pollutes the minidumps. + // We thus test the stack pointer and exclude any threads that are part of + // the seccomp sandbox's trusted code. + user_regs_struct regs; + if (sys_ptrace(PTRACE_GETREGS, pid, NULL, ®s) == -1 || +#if defined(__i386) + !regs.esp +#elif defined(__x86_64) + !regs.rsp +#endif + ) { + sys_ptrace(PTRACE_DETACH, pid, NULL, NULL); + return false; + } +#endif return true; } @@ -138,11 +158,19 @@ bool LinuxDumper::Init() { bool LinuxDumper::ThreadsAttach() { if (threads_suspended_) return true; - bool good = true; - for (size_t i = 0; i < threads_.size(); ++i) - good &= AttachThread(threads_[i]); + for (size_t i = 0; i < threads_.size(); ++i) { + if (!AttachThread(threads_[i])) { + // If the thread either disappeared before we could attach to it, or if + // it was part of the seccomp sandbox's trusted code, it is OK to + // silently drop it from the minidump. + memmove(&threads_[i], &threads_[i+1], + (threads_.size() - i - 1) * sizeof(threads_[i])); + threads_.resize(threads_.size() - 1); + --i; + } + } threads_suspended_ = true; - return good; + return threads_.size() > 0; } bool LinuxDumper::ThreadsDetach() { diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_extension_linux.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_extension_linux.h new file mode 100644 index 00000000000..25bd8eb46d3 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_extension_linux.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2010, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_extension_linux.h: A definition of exception codes for + * Linux + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Author: Adam Langley + * Split into its own file: Markus Gutschke */ + + +#ifndef SRC_CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_EXTENSION_LINUX_H_ +#define SRC_CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_EXTENSION_LINUX_H_ + +#include + +#include "google_breakpad/common/breakpad_types.h" + +// These are additional minidump stream values which are specific to the linux +// breakpad implementation. +enum { + MD_LINUX_CPU_INFO = 0x47670003, /* /proc/cpuinfo */ + MD_LINUX_PROC_STATUS = 0x47670004, /* /proc/$x/status */ + MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ + MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ + MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ + MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */ + MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */ + MD_LINUX_DSO_DEBUG = 0x4767000A /* DSO data */ +}; + +typedef struct { + void* addr; + MDRVA name; + void* ld; +} MDRawLinkMap; + +typedef struct { + u_int32_t version; + MDRVA map; + u_int32_t dso_count; + void* brk; + void* ldbase; + void* dynamic; +} MDRawDebug; + +#endif // SRC_CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_EXTENSION_LINUX_H_ diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc index e2a4375228f..5acf57b9f90 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -62,22 +63,12 @@ #include "client/linux/handler/exception_handler.h" #include "client/linux/minidump_writer/line_reader.h" #include "client/linux/minidump_writer/linux_dumper.h" +#include "client/linux/minidump_writer/minidump_extension_linux.h" #include "common/linux/linux_libc_support.h" #include "common/linux/linux_syscall_support.h" using google_breakpad::ThreadInfo; -// These are additional minidump stream values which are specific to the linux -// breakpad implementation. -enum { - MD_LINUX_CPU_INFO = 0x47670003, /* /proc/cpuinfo */ - MD_LINUX_PROC_STATUS = 0x47670004, /* /proc/$x/status */ - MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ - MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ - MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ - MD_LINUX_AUXV = 0x47670008 /* /proc/$x/auxv */ -}; - // Minidump defines register structures which are different from the raw // structures which we get from the kernel. These are platform specific // functions to juggle the ucontext and user structures into minidump format. @@ -457,9 +448,26 @@ class MinidumpWriter { } bool Dump() { + // The dynamic linker makes information available that helps gdb find all + // DSOs loaded into the program. If we can access this information, we dump + // it to a MD_LINUX_DSO_DEBUG stream. + struct r_debug* r_debug = NULL; + uint32_t dynamic_length = 0; + + for (int i = 0;;) { + ElfW(Dyn) dyn; + dynamic_length += sizeof(dyn); + dumper_.CopyFromProcess(&dyn, crashing_tid_, _DYNAMIC+i++, sizeof(dyn)); + if (dyn.d_tag == DT_DEBUG) { + r_debug = (struct r_debug*)dyn.d_un.d_ptr; + continue; + } else if (dyn.d_tag == DT_NULL) + break; + } + // A minidump file contains a number of tagged streams. This is the number // of stream which we write. - static const unsigned kNumWriters = 11; + const unsigned kNumWriters = 11 + !!r_debug; TypedMDRVA header(&minidump_writer_); TypedMDRVA dir(&minidump_writer_); @@ -526,11 +534,18 @@ class MinidumpWriter { NullifyDirectoryEntry(&dirent); dir.CopyIndex(dir_index++, &dirent); - dirent.stream_type = MD_LINUX_AUXV; + dirent.stream_type = MD_LINUX_MAPS; if (!WriteProcFile(&dirent.location, crashing_tid_, "maps")) NullifyDirectoryEntry(&dirent); dir.CopyIndex(dir_index++, &dirent); + if (r_debug) { + dirent.stream_type = MD_LINUX_DSO_DEBUG; + if (!WriteDSODebugStream(&dirent, r_debug, dynamic_length)) + NullifyDirectoryEntry(&dirent); + dir.CopyIndex(dir_index++, &dirent); + } + // If you add more directory entries, don't forget to update kNumWriters, // above. @@ -538,6 +553,123 @@ class MinidumpWriter { return true; } + // Check if the top of the stack is part of a system call that has been + // redirected by the seccomp sandbox. If so, try to pop the stack frames + // all the way back to the point where the interception happened. + void PopSeccompStackFrame(RawContextCPU* cpu, const MDRawThread& thread, + uint8_t* stack_copy) { +#if defined(__x86_64) + u_int64_t bp = cpu->rbp; + u_int64_t top = thread.stack.start_of_memory_range; + for (int i = 4; i--; ) { + if (bp < top || + bp + sizeof(bp) > thread.stack.start_of_memory_range + + thread.stack.memory.data_size || + bp & 1) { + break; + } + uint64_t old_top = top; + top = bp; + u_int8_t* bp_addr = stack_copy + bp - thread.stack.start_of_memory_range; + memcpy(&bp, bp_addr, sizeof(bp)); + if (bp == 0xDEADBEEFDEADBEEFull) { + struct { + uint64_t r15; + uint64_t r14; + uint64_t r13; + uint64_t r12; + uint64_t r11; + uint64_t r10; + uint64_t r9; + uint64_t r8; + uint64_t rdi; + uint64_t rsi; + uint64_t rdx; + uint64_t rcx; + uint64_t rbx; + uint64_t deadbeef; + uint64_t rbp; + uint64_t fakeret; + uint64_t ret; + /* char redzone[128]; */ + } seccomp_stackframe; + if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top || + top - offsetof(typeof(seccomp_stackframe), deadbeef) + + sizeof(seccomp_stackframe) > + thread.stack.start_of_memory_range+thread.stack.memory.data_size) { + break; + } + memcpy(&seccomp_stackframe, + bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef), + sizeof(seccomp_stackframe)); + cpu->rbx = seccomp_stackframe.rbx; + cpu->rcx = seccomp_stackframe.rcx; + cpu->rdx = seccomp_stackframe.rdx; + cpu->rsi = seccomp_stackframe.rsi; + cpu->rdi = seccomp_stackframe.rdi; + cpu->rbp = seccomp_stackframe.rbp; + cpu->rsp = top + 4*sizeof(uint64_t) + 128; + cpu->r8 = seccomp_stackframe.r8; + cpu->r9 = seccomp_stackframe.r9; + cpu->r10 = seccomp_stackframe.r10; + cpu->r11 = seccomp_stackframe.r11; + cpu->r12 = seccomp_stackframe.r12; + cpu->r13 = seccomp_stackframe.r13; + cpu->r14 = seccomp_stackframe.r14; + cpu->r15 = seccomp_stackframe.r15; + cpu->rip = seccomp_stackframe.fakeret; + return; + } + } +#elif defined(__i386) + u_int32_t bp = cpu->ebp; + u_int32_t top = thread.stack.start_of_memory_range; + for (int i = 4; i--; ) { + if (bp < top || + bp + sizeof(bp) > thread.stack.start_of_memory_range + + thread.stack.memory.data_size || + bp & 1) { + break; + } + uint32_t old_top = top; + top = bp; + u_int8_t* bp_addr = stack_copy + bp - thread.stack.start_of_memory_range; + memcpy(&bp, bp_addr, sizeof(bp)); + if (bp == 0xDEADBEEFu) { + struct { + uint32_t edi; + uint32_t esi; + uint32_t edx; + uint32_t ecx; + uint32_t ebx; + uint32_t deadbeef; + uint32_t ebp; + uint32_t fakeret; + uint32_t ret; + } seccomp_stackframe; + if (top - offsetof(typeof(seccomp_stackframe), deadbeef) < old_top || + top - offsetof(typeof(seccomp_stackframe), deadbeef) + + sizeof(seccomp_stackframe) > + thread.stack.start_of_memory_range+thread.stack.memory.data_size) { + break; + } + memcpy(&seccomp_stackframe, + bp_addr - offsetof(typeof(seccomp_stackframe), deadbeef), + sizeof(seccomp_stackframe)); + cpu->ebx = seccomp_stackframe.ebx; + cpu->ecx = seccomp_stackframe.ecx; + cpu->edx = seccomp_stackframe.edx; + cpu->esi = seccomp_stackframe.esi; + cpu->edi = seccomp_stackframe.edi; + cpu->ebp = seccomp_stackframe.ebp; + cpu->esp = top + 4*sizeof(void*); + cpu->eip = seccomp_stackframe.fakeret; + return; + } + } +#endif + } + // Write information about the threads. bool WriteThreadListStream(MDRawDirectory* dirent) { const unsigned num_threads = dumper_.threads().size(); @@ -578,6 +710,7 @@ class MinidumpWriter { return false; my_memset(cpu.get(), 0, sizeof(RawContextCPU)); CPUFillFromUContext(cpu.get(), ucontext_, float_state_); + PopSeccompStackFrame(cpu.get(), thread, stack_copy); thread.thread_context = cpu.location(); crashing_thread_context_ = cpu.location(); } else { @@ -600,6 +733,7 @@ class MinidumpWriter { return false; my_memset(cpu.get(), 0, sizeof(RawContextCPU)); CPUFillFromThreadInfo(cpu.get(), info); + PopSeccompStackFrame(cpu.get(), thread, stack_copy); thread.thread_context = cpu.location(); if ((pid_t)thread.thread_id == crashing_tid_) { @@ -738,6 +872,83 @@ class MinidumpWriter { return true; } + bool WriteDSODebugStream(MDRawDirectory* dirent, struct r_debug* r_debug, + uint32_t dynamic_length) { + // The caller provided us with a pointer to "struct r_debug". We can + // look up the "r_map" field to get a linked list of all loaded DSOs. + // Our list of DSOs potentially is different from the ones in the crashing + // process. So, we have to be careful to never dereference pointers + // directly. Instead, we use CopyFromProcess() everywhere. + // See for a more detailed discussion of the how the dynamic + // loader communicates with debuggers. + + // Count the number of loaded DSOs + int dso_count = 0; + struct r_debug debug_entry; + dumper_.CopyFromProcess(&debug_entry, crashing_tid_, r_debug, + sizeof(debug_entry)); + for (struct link_map* ptr = debug_entry.r_map; ptr; ) { + struct link_map map; + dumper_.CopyFromProcess(&map, crashing_tid_, ptr, sizeof(map)); + ptr = map.l_next; + dso_count++; + } + + MDRVA linkmap_rva = minidump_writer_.kInvalidMDRVA; + if (dso_count > 0) { + // If we have at least one DSO, create an array of MDRawLinkMap + // entries in the minidump file. + TypedMDRVA linkmap(&minidump_writer_); + if (!linkmap.AllocateArray(dso_count)) + return false; + linkmap_rva = linkmap.location().rva; + int idx = 0; + + // Iterate over DSOs and write their information to mini dump + for (struct link_map* ptr = debug_entry.r_map; ptr; ) { + struct link_map map; + dumper_.CopyFromProcess(&map, crashing_tid_, ptr, sizeof(map)); + ptr = map.l_next; + char filename[257] = { 0 }; + if (map.l_name) { + dumper_.CopyFromProcess(filename, crashing_tid_, map.l_name, + sizeof(filename) - 1); + } + MDLocationDescriptor location; + if (!minidump_writer_.WriteString(filename, 0, &location)) + return false; + MDRawLinkMap entry; + entry.name = location.rva; + entry.addr = (void*)map.l_addr; + entry.ld = (void*)map.l_ld; + linkmap.CopyIndex(idx++, &entry); + } + } + + // Write MD_LINUX_DSO_DEBUG record + TypedMDRVA debug(&minidump_writer_); + if (!debug.AllocateObjectAndArray(1, dynamic_length)) + return false; + my_memset(debug.get(), 0, sizeof(MDRawDebug)); + dirent->stream_type = MD_LINUX_DSO_DEBUG; + dirent->location = debug.location(); + + debug.get()->version = debug_entry.r_version; + debug.get()->map = linkmap_rva; + debug.get()->dso_count = dso_count; + debug.get()->brk = (void*)debug_entry.r_brk; + debug.get()->ldbase = (void*)debug_entry.r_ldbase; + debug.get()->dynamic = (void*)&_DYNAMIC; + + char *dso_debug_data = new char[dynamic_length]; + dumper_.CopyFromProcess(dso_debug_data, crashing_tid_, &_DYNAMIC, + dynamic_length); + debug.CopyIndexAfterObject(0, dso_debug_data, dynamic_length); + delete[] dso_debug_data; + + return true; + } + private: void NullifyDirectoryEntry(MDRawDirectory* dirent) { dirent->stream_type = 0; @@ -787,7 +998,7 @@ class MinidumpWriter { i < sizeof(cpu_info_table) / sizeof(cpu_info_table[0]); i++) { CpuInfoEntry* entry = &cpu_info_table[i]; - if (entry->found) + if (entry->found && i) continue; if (!strncmp(line, entry->info_name, strlen(entry->info_name))) { const char* value = strchr(line, ':'); @@ -873,29 +1084,48 @@ popline: // We can't stat the files because several of the files that we want to // read are kernel seqfiles, which always have a length of zero. So we have // to read as much as we can into a buffer. - static const unsigned kMaxFileSize = 1024; - uint8_t* data = (uint8_t*) dumper_.allocator()->Alloc(kMaxFileSize); + static const unsigned kBufSize = 1024 - 2*sizeof(void*); + struct Buffers { + struct Buffers* next; + size_t len; + uint8_t data[kBufSize]; + } *buffers = + (struct Buffers*) dumper_.allocator()->Alloc(sizeof(struct Buffers)); + buffers->next = NULL; + buffers->len = 0; - size_t done = 0; - while (done < kMaxFileSize) { + size_t total = 0; + for (struct Buffers* bufptr = buffers;;) { ssize_t r; do { - r = sys_read(fd, data + done, kMaxFileSize - done); + r = sys_read(fd, &bufptr->data[bufptr->len], kBufSize - bufptr->len); } while (r == -1 && errno == EINTR); if (r < 1) break; - done += r; + + total += r; + bufptr->len += r; + if (bufptr->len == kBufSize) { + bufptr->next = + (struct Buffers*) dumper_.allocator()->Alloc(sizeof(struct Buffers)); + bufptr = bufptr->next; + bufptr->next = NULL; + bufptr->len = 0; + } } sys_close(fd); - if (!done) + if (!total) return false; UntypedMDRVA memory(&minidump_writer_); - if (!memory.Allocate(done)) + if (!memory.Allocate(total)) return false; - memory.Copy(data, done); + for (MDRVA pos = memory.position(); buffers; buffers = buffers->next) { + memory.Copy(pos, &buffers->data, buffers->len); + pos += buffers->len; + } *result = memory.location(); return true; } diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj index f6cdcc0037d..b6bb5fe767f 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXAggregateTarget section */ @@ -22,6 +22,12 @@ F95BB8B3101F94D300AA053B /* PBXTargetDependency */, F95BB8B5101F94D300AA053B /* PBXTargetDependency */, F95BB8B7101F94D300AA053B /* PBXTargetDependency */, + 8B31023911F0CF0600FCF3E4 /* PBXTargetDependency */, + 8B31051711F1010E00FCF3E4 /* PBXTargetDependency */, + 8B31051911F1010E00FCF3E4 /* PBXTargetDependency */, + 8B31051B11F1010E00FCF3E4 /* PBXTargetDependency */, + 8B31051D11F1010E00FCF3E4 /* PBXTargetDependency */, + 8B31051F11F1010E00FCF3E4 /* PBXTargetDependency */, ); name = All; productName = All; @@ -32,10 +38,58 @@ 3329D4ED0FA16D820007BBC5 /* Breakpad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */; }; 33880C800F9E097100817F82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33880C7E0F9E097100817F82 /* InfoPlist.strings */; }; 4084699D0F5D9CF900FDCA37 /* crash_report_sender.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */; }; + 8B3101C611F0CD9F00FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; + 8B3101C711F0CD9F00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B3101CA11F0CDB000FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; + 8B3101CB11F0CDB000FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B3101EA11F0CDE300FCF3E4 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */; }; + 8B31029411F0D54300FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B3102E611F0D74C00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B3102EB11F0D78000FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B31FC8211EFD2B800FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 8B4BDAAF12012BC5009C7060 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */; }; + 8B4BDABE12012CEF009C7060 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */; }; + 8B4BDAC512012D05009C7060 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */; }; 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; + D24BBBFD121050F000F3D417 /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; + D24BBD291211EDB100F3D417 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; }; + D24BBD321212CACF00F3D417 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; }; D2A5DD301188633800081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; }; D2A5DD401188640400081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; }; D2A5DD411188642E00081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; }; + D2F9A3D51212F87C002747C1 /* exception_handler_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */; }; + D2F9A43D12131F55002747C1 /* gmock-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43C12131F55002747C1 /* gmock-all.cc */; }; + D2F9A44012131F65002747C1 /* gtest_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43E12131F65002747C1 /* gtest_main.cc */; }; + D2F9A44112131F65002747C1 /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43F12131F65002747C1 /* gtest-all.cc */; }; + D2F9A44412131F84002747C1 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2F9A41512131EF0002747C1 /* libgtest.a */; }; + D2F9A4C9121336C7002747C1 /* client_info.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C4121336C7002747C1 /* client_info.h */; }; + D2F9A4CA121336C7002747C1 /* crash_generation_client.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C5121336C7002747C1 /* crash_generation_client.h */; }; + D2F9A4CB121336C7002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; }; + D2F9A4CC121336C7002747C1 /* crash_generation_server.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C7121336C7002747C1 /* crash_generation_server.h */; }; + D2F9A4CD121336C7002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; }; + D2F9A4DF12133AD9002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; }; + D2F9A4E012133AD9002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; }; + D2F9A4E112133AE2002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; }; + D2F9A4E212133AE2002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; }; + D2F9A52E121383A1002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; }; + D2F9A52F121383A1002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; }; + D2F9A530121383A1002747C1 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; }; + D2F9A531121383A1002747C1 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; }; + D2F9A532121383A1002747C1 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; + D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; + D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; }; + D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; }; + D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; }; + D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; }; + D2F9A538121383A1002747C1 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; }; + D2F9A539121383A1002747C1 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; }; + D2F9A53A121383A1002747C1 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; }; + D2F9A53B121383A1002747C1 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; }; + D2F9A53C121383A1002747C1 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; }; + D2F9A53F121383A1002747C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + D2F9A540121383A1002747C1 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */; }; + D2F9A541121383A1002747C1 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2F9A41512131EF0002747C1 /* libgtest.a */; }; + D2F9A553121383DC002747C1 /* crash_generation_server_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */; }; F91AF5D00FD60393009D8BE2 /* BreakpadFramework_Test.mm in Sources */ = {isa = PBXBuildFile; fileRef = F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */; }; F91AF6210FD60784009D8BE2 /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; F9286B3A0F7EB25800A4DCC8 /* InspectorMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */; }; @@ -92,7 +146,6 @@ F93DE33D0F82C66B00608B94 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; }; F93DE33E0F82C66B00608B94 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; }; F93DE33F0F82C66B00608B94 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; }; - F93DE3410F82C68300608B94 /* exception_handler_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F93DE3400F82C68300608B94 /* exception_handler_test.cc */; }; F945849E0F280E3C009A47BF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F945849C0F280E3C009A47BF /* Localizable.strings */; }; F9B630A0100FF96B00D0F4AC /* goArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = F9B6309F100FF96B00D0F4AC /* goArrow.png */; }; F9C44DB20EF07288003AEBAA /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44DAC0EF07288003AEBAA /* Controller.m */; }; @@ -114,6 +167,167 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 8B31023811F0CF0600FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B88FAFC9116BDCAD00407530; + remoteInfo = all_unittests; + }; + 8B31051611F1010E00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F93803BD0F80820F004D428B; + remoteInfo = generator_test; + }; + 8B31051811F1010E00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F93DE2D00F82A67300608B94; + remoteInfo = minidump_file_writer_unittest; + }; + 8B31051A11F1010E00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F93DE32B0F82C55600608B94; + remoteInfo = handler_test; + }; + 8B31051C11F1010E00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = B89E0E731166575200DD08C9; + remoteInfo = macho_dump; + }; + 8B31051E11F1010E00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB894101F94C000AA053B /* symupload.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 9BD835FA0B0544950055103E; + remoteInfo = minidump_upload; + }; + 8B31F7A011EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B89E0E741166575200DD08C9; + remoteInfo = macho_dump; + }; + 8B31F7A211EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB024116BDFFF00407530; + remoteInfo = gtestmockall; + }; + 8B31F7A411EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB14B116CF4A700407530; + remoteInfo = byte_cursor_unittest; + }; + 8B31F7A611EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B89E0E9511665A6400DD08C9; + remoteInfo = macho_reader_unittest; + }; + 8B31F7A811EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB007116BDE8300407530; + remoteInfo = stabs_reader_unittest; + }; + 8B31F7AA11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB135116CF30F00407530; + remoteInfo = bytereader_unittest; + }; + 8B31F7AC11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FAF2F116A591E00407530; + remoteInfo = dwarf2reader_cfi_unittest; + }; + 8B31F7AE11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB0DF116CEEA800407530; + remoteInfo = dwarf2diehandler_unittest; + }; + 8B31F7B011EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB10A116CF07900407530; + remoteInfo = dwarf_cu_to_module_unittest; + }; + 8B31F7B211EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB0F2116CEF1900407530; + remoteInfo = dwarf_line_to_module_unittest; + }; + 8B31F7B411EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB11F116CF27F00407530; + remoteInfo = dwarf_cfi_to_module_unittest; + }; + 8B31F7B611EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B84A91F4116CF784006C210E; + remoteInfo = stabs_to_module_unittest; + }; + 8B31F7B811EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B88FB0B9116CEABF00407530; + remoteInfo = module_unittest; + }; + 8B31F7BA11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D21F97D211CBA0F200239E38; + remoteInfo = test_assembler_unittest; + }; + D2F9A44212131F80002747C1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2F9A41412131EF0002747C1; + remoteInfo = gtest; + }; + D2F9A52C121383A1002747C1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2F9A41412131EF0002747C1; + remoteInfo = gtest; + }; + D2F9A5DE12142A6A002747C1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2F9A52A121383A1002747C1; + remoteInfo = crash_generation_server_test; + }; F91AF6370FD60A74009D8BE2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -230,7 +444,7 @@ isa = PBXContainerItemProxy; containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 8DD76F960486AA7600D96B5E; + remoteGlobalIDString = B8C5B5101166531A00D34F4E; remoteInfo = dump_syms; }; F95BB8B4101F94D300AA053B /* PBXContainerItemProxy */ = { @@ -278,14 +492,55 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 32DBCF5E0370ADEE00C91783 /* Breakpad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpad_Prefix.pch; path = Framework/Breakpad_Prefix.pch; sourceTree = ""; }; 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Breakpad.xib; path = sender/Breakpad.xib; sourceTree = ""; }; 33880C7F0F9E097100817F82 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = sender/English.lproj/InfoPlist.strings; sourceTree = ""; }; 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = crash_report_sender.icns; path = sender/crash_report_sender.icns; sourceTree = ""; }; + 8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = ../../common/mac/GTMDefines.h; sourceTree = SOURCE_ROOT; }; + 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 8B31022211F0CE1000FCF3E4 /* GTMGarbageCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMGarbageCollection.h; path = ../../common/mac/GTMGarbageCollection.h; sourceTree = SOURCE_ROOT; }; + 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B31FFF611F0C90500FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; 8DC2EF5B0486A6940098B216 /* Breakpad.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Breakpad.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler_test.cc; path = tests/exception_handler_test.cc; sourceTree = ""; }; + D2F9A41512131EF0002747C1 /* libgtest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; }; + D2F9A43C12131F55002747C1 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../testing/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; }; + D2F9A43E12131F65002747C1 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../testing/gtest/src/gtest_main.cc; sourceTree = ""; }; + D2F9A43F12131F65002747C1 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../testing/gtest/src/gtest-all.cc"; sourceTree = ""; }; + D2F9A4C4121336C7002747C1 /* client_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = client_info.h; path = crash_generation/client_info.h; sourceTree = ""; }; + D2F9A4C5121336C7002747C1 /* crash_generation_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_generation_client.h; path = crash_generation/crash_generation_client.h; sourceTree = ""; }; + D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_client.cc; path = crash_generation/crash_generation_client.cc; sourceTree = ""; }; + D2F9A4C7121336C7002747C1 /* crash_generation_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_generation_server.h; path = crash_generation/crash_generation_server.h; sourceTree = ""; }; + D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_server.cc; path = crash_generation/crash_generation_server.cc; sourceTree = ""; }; + D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_server_test.cc; path = tests/crash_generation_server_test.cc; sourceTree = ""; }; + D2F9A546121383A1002747C1 /* crash_generation_server_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = crash_generation_server_test; sourceTree = BUILT_PRODUCTS_DIR; }; + DE43467411C72855004F095F /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = sender/da.lproj/Localizable.strings; sourceTree = ""; }; + DE43467511C72857004F095F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = sender/de.lproj/Localizable.strings; sourceTree = ""; }; + DE43467611C7285B004F095F /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = sender/es.lproj/Localizable.strings; sourceTree = ""; }; + DE43467711C72862004F095F /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = sender/fr.lproj/Localizable.strings; sourceTree = ""; }; + DE43467811C72869004F095F /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = sender/it.lproj/Localizable.strings; sourceTree = ""; }; + DE43467911C7286D004F095F /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = sender/nl.lproj/Localizable.strings; sourceTree = ""; }; + DE43467A11C72873004F095F /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = sender/no.lproj/Localizable.strings; sourceTree = ""; }; + DE43467B11C72877004F095F /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sender/sl.lproj/Localizable.strings; sourceTree = ""; }; + DE43467C11C7287A004F095F /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sender/sv.lproj/Localizable.strings; sourceTree = ""; }; + DE43467E11C728DC004F095F /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = sender/ja.lproj/Localizable.strings; sourceTree = ""; }; + DE43467F11C728E1004F095F /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = sender/tr.lproj/Localizable.strings; sourceTree = ""; }; + DE43468611C72958004F095F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = sender/de.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468711C7295D004F095F /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = sender/da.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468811C7295F004F095F /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = sender/es.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468911C72964004F095F /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = sender/fr.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468A11C72967004F095F /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = sender/it.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468B11C7296B004F095F /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = sender/ja.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468C11C7296D004F095F /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = sender/nl.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468D11C7296F004F095F /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = sender/no.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468E11C72971004F095F /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sender/sl.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43468F11C72973004F095F /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sender/sv.lproj/InfoPlist.strings; sourceTree = ""; }; + DE43469011C72976004F095F /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = sender/tr.lproj/InfoPlist.strings; sourceTree = ""; }; F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = BreakpadFramework_Test.mm; path = tests/BreakpadFramework_Test.mm; sourceTree = ""; }; F9286B380F7EB25800A4DCC8 /* Inspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Inspector.h; path = crash_generation/Inspector.h; sourceTree = ""; }; F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InspectorMain.mm; path = crash_generation/InspectorMain.mm; sourceTree = ""; }; @@ -326,7 +581,7 @@ F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ../minidump_file_writer.cc; sourceTree = SOURCE_ROOT; }; F92C53900ECCE70A009BE4BA /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_file_writer.h; path = ../minidump_file_writer.h; sourceTree = SOURCE_ROOT; }; F92C53B70ECCE7B3009BE4BA /* Inspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Inspector.mm; path = crash_generation/Inspector.mm; sourceTree = SOURCE_ROOT; }; - F92C554A0ECCF530009BE4BA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + F92C554A0ECCF530009BE4BA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; F92C55CE0ECD0064009BE4BA /* Breakpad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpad.h; path = Framework/Breakpad.h; sourceTree = ""; }; F92C55CF0ECD0064009BE4BA /* Breakpad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Breakpad.mm; path = Framework/Breakpad.mm; sourceTree = ""; }; F92C56310ECD0DF1009BE4BA /* OnDemandServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OnDemandServer.h; path = Framework/OnDemandServer.h; sourceTree = ""; }; @@ -341,7 +596,6 @@ F93DE2D10F82A67300608B94 /* minidump_file_writer_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidump_file_writer_unittest; sourceTree = BUILT_PRODUCTS_DIR; }; F93DE2D70F82A70E00608B94 /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer_unittest.cc; path = ../minidump_file_writer_unittest.cc; sourceTree = SOURCE_ROOT; }; F93DE32C0F82C55600608B94 /* handler_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = handler_test; sourceTree = BUILT_PRODUCTS_DIR; }; - F93DE3400F82C68300608B94 /* exception_handler_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler_test.cc; path = handler/exception_handler_test.cc; sourceTree = ""; }; F945849D0F280E3C009A47BF /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = sender/English.lproj/Localizable.strings; sourceTree = ""; }; F945859D0F78241E009A47BF /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Framework/Info.plist; sourceTree = ""; }; F95BB87C101F949F00AA053B /* crash_report.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = crash_report.xcodeproj; path = ../../tools/mac/crash_report/crash_report.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -359,7 +613,7 @@ F9C44DBB0EF072A0003AEBAA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = testapp/English.lproj/MainMenu.xib; sourceTree = ""; }; F9C44DBF0EF0778F003AEBAA /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Controller.h; path = testapp/Controller.h; sourceTree = ""; }; F9C44DC00EF0778F003AEBAA /* TestClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestClass.h; path = testapp/TestClass.h; sourceTree = ""; }; - F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; + F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; F9C44EE70EF0A3C1003AEBAA /* GTMLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMLogger.h; path = ../../common/mac/GTMLogger.h; sourceTree = SOURCE_ROOT; }; F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMLogger.m; path = ../../common/mac/GTMLogger.m; sourceTree = SOURCE_ROOT; }; F9C77DDA0F7DD5CF0045F7DB /* UnitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -380,6 +634,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D2F9A41312131EF0002747C1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2F9A53E121383A1002747C1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D2F9A53F121383A1002747C1 /* Foundation.framework in Frameworks */, + D2F9A540121383A1002747C1 /* libcrypto.dylib in Frameworks */, + D2F9A541121383A1002747C1 /* libgtest.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F92C53520ECCE349009BE4BA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -393,7 +664,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8B31FC8211EFD2B800FCF3E4 /* Foundation.framework in Frameworks */, F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */, + 8B4BDAAF12012BC5009C7060 /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -402,6 +675,8 @@ buildActionMask = 2147483647; files = ( F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */, + 8B3101C611F0CD9F00FCF3E4 /* AppKit.framework in Frameworks */, + 8B3101C711F0CD9F00FCF3E4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -409,6 +684,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8B31029411F0D54300FCF3E4 /* Foundation.framework in Frameworks */, + 8B4BDABE12012CEF009C7060 /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -423,6 +700,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8B3102E611F0D74C00FCF3E4 /* Foundation.framework in Frameworks */, + 8B4BDAC512012D05009C7060 /* libcrypto.dylib in Frameworks */, + D2F9A44412131F84002747C1 /* libgtest.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -431,6 +711,8 @@ buildActionMask = 2147483647; files = ( F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */, + 8B3101CA11F0CDB000FCF3E4 /* AppKit.framework in Frameworks */, + 8B3101CB11F0CDB000FCF3E4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -439,6 +721,9 @@ buildActionMask = 2147483647; files = ( F91AF6210FD60784009D8BE2 /* Breakpad.framework in Frameworks */, + 8B3101EA11F0CDE300FCF3E4 /* SenTestingKit.framework in Frameworks */, + 8B3102EB11F0D78000FCF3E4 /* Foundation.framework in Frameworks */, + D24BBBFD121050F000F3D417 /* breakpadUtilities.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -457,6 +742,8 @@ F93803BE0F80820F004D428B /* generator_test */, F93DE2D10F82A67300608B94 /* minidump_file_writer_unittest */, F93DE32C0F82C55600608B94 /* handler_test */, + D2F9A41512131EF0002747C1 /* libgtest.a */, + D2F9A546121383A1002747C1 /* crash_generation_server_test */, ); name = Products; sourceTree = ""; @@ -464,6 +751,10 @@ 0867D691FE84028FC02AAC07 /* Breakpad */ = { isa = PBXGroup; children = ( + D2F9A43812131F3B002747C1 /* gtest */, + 8B31FFF611F0C90500FCF3E4 /* Breakpad.xcconfig */, + 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */, + 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */, F95BB8A3101F94C300AA053B /* Tools */, 32DBCF5E0370ADEE00C91783 /* Breakpad_Prefix.pch */, F92C538D0ECCE6F2009BE4BA /* client */, @@ -478,6 +769,8 @@ 0867D69AFE84028FC02AAC07 /* Frameworks */ = { isa = PBXGroup; children = ( + 8B4BDAA7120124EA009C7060 /* libcrypto.dylib */, + 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */, F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */, F92C554A0ECCF530009BE4BA /* Carbon.framework */, 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, @@ -487,10 +780,19 @@ name = Frameworks; sourceTree = ""; }; + D2F9A43812131F3B002747C1 /* gtest */ = { + isa = PBXGroup; + children = ( + D2F9A43E12131F65002747C1 /* gtest_main.cc */, + D2F9A43F12131F65002747C1 /* gtest-all.cc */, + D2F9A43C12131F55002747C1 /* gmock-all.cc */, + ); + name = gtest; + sourceTree = ""; + }; F92C53590ECCE3BB009BE4BA /* handler */ = { isa = PBXGroup; children = ( - F93DE3400F82C68300608B94 /* exception_handler_test.cc */, F93803D90F8083D8004D428B /* minidump_generator_test.cc */, F92C53670ECCE3FD009BE4BA /* breakpad_exc_server.c */, F92C53680ECCE3FD009BE4BA /* breakpad_exc_server.h */, @@ -523,6 +825,8 @@ F92C53840ECCE68D009BE4BA /* mac */ = { isa = PBXGroup; children = ( + 8B31022211F0CE1000FCF3E4 /* GTMGarbageCollection.h */, + 8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */, F9C77E0F0F7DDF650045F7DB /* testing */, F9C44EE70EF0A3C1003AEBAA /* GTMLogger.h */, F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */, @@ -574,6 +878,11 @@ F92C53B50ECCE799009BE4BA /* crash_generation */ = { isa = PBXGroup; children = ( + D2F9A4C4121336C7002747C1 /* client_info.h */, + D2F9A4C5121336C7002747C1 /* crash_generation_client.h */, + D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */, + D2F9A4C7121336C7002747C1 /* crash_generation_server.h */, + D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */, F9286B380F7EB25800A4DCC8 /* Inspector.h */, F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */, F92C53B70ECCE7B3009BE4BA /* Inspector.mm */, @@ -620,6 +929,20 @@ isa = PBXGroup; children = ( F95BB892101F94AC00AA053B /* dump_syms */, + 8B31F7A111EF9A8700FCF3E4 /* macho_dump */, + 8B31F7A311EF9A8700FCF3E4 /* libgtestmockall.a */, + 8B31F7A511EF9A8700FCF3E4 /* byte_cursor_unittest */, + 8B31F7A711EF9A8700FCF3E4 /* macho_reader_unittest */, + 8B31F7A911EF9A8700FCF3E4 /* stabs_reader_unittest */, + 8B31F7AB11EF9A8700FCF3E4 /* bytereader_unittest */, + 8B31F7AD11EF9A8700FCF3E4 /* dwarf2reader_cfi_unittest */, + 8B31F7AF11EF9A8700FCF3E4 /* dwarf2diehandler_unittest */, + 8B31F7B111EF9A8700FCF3E4 /* dwarf_cu_to_module_unittest */, + 8B31F7B311EF9A8700FCF3E4 /* dwarf_line_to_module_unittest */, + 8B31F7B511EF9A8700FCF3E4 /* dwarf_cfi_to_module_unittest */, + 8B31F7B711EF9A8700FCF3E4 /* stabs_to_module_unittest */, + 8B31F7B911EF9A8700FCF3E4 /* module_unittest */, + 8B31F7BB11EF9A8700FCF3E4 /* test_assembler_unittest */, ); name = Products; sourceTree = ""; @@ -663,6 +986,8 @@ F9C77DDF0F7DD7CF0045F7DB /* tests */ = { isa = PBXGroup; children = ( + D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */, + D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */, F9C77DE00F7DD7E30045F7DB /* SimpleStringDictionaryTest.h */, F9C77DE10F7DD7E30045F7DB /* SimpleStringDictionaryTest.mm */, F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */, @@ -688,6 +1013,16 @@ files = ( F92C55D00ECD0064009BE4BA /* Breakpad.h in Headers */, F92C56330ECD0DF1009BE4BA /* OnDemandServer.h in Headers */, + D2F9A4C9121336C7002747C1 /* client_info.h in Headers */, + D2F9A4CA121336C7002747C1 /* crash_generation_client.h in Headers */, + D2F9A4CC121336C7002747C1 /* crash_generation_server.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2F9A41112131EF0002747C1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; }; @@ -724,6 +1059,40 @@ productReference = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; productType = "com.apple.product-type.framework"; }; + D2F9A41412131EF0002747C1 /* gtest */ = { + isa = PBXNativeTarget; + buildConfigurationList = D2F9A42D12131F0E002747C1 /* Build configuration list for PBXNativeTarget "gtest" */; + buildPhases = ( + D2F9A41112131EF0002747C1 /* Headers */, + D2F9A41212131EF0002747C1 /* Sources */, + D2F9A41312131EF0002747C1 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = gtest; + productName = gtest; + productReference = D2F9A41512131EF0002747C1 /* libgtest.a */; + productType = "com.apple.product-type.library.static"; + }; + D2F9A52A121383A1002747C1 /* crash_generation_server_test */ = { + isa = PBXNativeTarget; + buildConfigurationList = D2F9A542121383A1002747C1 /* Build configuration list for PBXNativeTarget "crash_generation_server_test" */; + buildPhases = ( + D2F9A52D121383A1002747C1 /* Sources */, + D2F9A53E121383A1002747C1 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + D2F9A52B121383A1002747C1 /* PBXTargetDependency */, + ); + name = crash_generation_server_test; + productName = handler_test; + productReference = D2F9A546121383A1002747C1 /* crash_generation_server_test */; + productType = "com.apple.product-type.tool"; + }; F92C53530ECCE349009BE4BA /* Inspector */ = { isa = PBXNativeTarget; buildConfigurationList = F92C53580ECCE36D009BE4BA /* Build configuration list for PBXNativeTarget "Inspector" */; @@ -818,6 +1187,7 @@ buildRules = ( ); dependencies = ( + D2F9A44312131F80002747C1 /* PBXTargetDependency */, ); name = handler_test; productName = handler_test; @@ -858,6 +1228,7 @@ F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */, F93DE3700F82CC1300608B94 /* PBXTargetDependency */, F91AF6380FD60A74009D8BE2 /* PBXTargetDependency */, + D2F9A5DF12142A6A002747C1 /* PBXTargetDependency */, ); name = UnitTests; productName = UnitTests; @@ -870,8 +1241,22 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; + knownRegions = ( + English, + da, + de, + es, + fr, + it, + ja, + nl, + no, + sl, + sv, + tr, + ); mainGroup = 0867D691FE84028FC02AAC07 /* Breakpad */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; @@ -901,11 +1286,111 @@ F93803BD0F80820F004D428B /* generator_test */, F93DE2D00F82A67300608B94 /* minidump_file_writer_unittest */, F93DE32B0F82C55600608B94 /* handler_test */, + D2F9A41412131EF0002747C1 /* gtest */, + D2F9A52A121383A1002747C1 /* crash_generation_server_test */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 8B31F7A111EF9A8700FCF3E4 /* macho_dump */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = macho_dump; + remoteRef = 8B31F7A011EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7A311EF9A8700FCF3E4 /* libgtestmockall.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libgtestmockall.a; + remoteRef = 8B31F7A211EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7A511EF9A8700FCF3E4 /* byte_cursor_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = byte_cursor_unittest; + remoteRef = 8B31F7A411EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7A711EF9A8700FCF3E4 /* macho_reader_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = macho_reader_unittest; + remoteRef = 8B31F7A611EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7A911EF9A8700FCF3E4 /* stabs_reader_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = stabs_reader_unittest; + remoteRef = 8B31F7A811EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7AB11EF9A8700FCF3E4 /* bytereader_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = bytereader_unittest; + remoteRef = 8B31F7AA11EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7AD11EF9A8700FCF3E4 /* dwarf2reader_cfi_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = dwarf2reader_cfi_unittest; + remoteRef = 8B31F7AC11EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7AF11EF9A8700FCF3E4 /* dwarf2diehandler_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = dwarf2diehandler_unittest; + remoteRef = 8B31F7AE11EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7B111EF9A8700FCF3E4 /* dwarf_cu_to_module_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = dwarf_cu_to_module_unittest; + remoteRef = 8B31F7B011EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7B311EF9A8700FCF3E4 /* dwarf_line_to_module_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = dwarf_line_to_module_unittest; + remoteRef = 8B31F7B211EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7B511EF9A8700FCF3E4 /* dwarf_cfi_to_module_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = dwarf_cfi_to_module_unittest; + remoteRef = 8B31F7B411EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7B711EF9A8700FCF3E4 /* stabs_to_module_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = stabs_to_module_unittest; + remoteRef = 8B31F7B611EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7B911EF9A8700FCF3E4 /* module_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = module_unittest; + remoteRef = 8B31F7B811EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8B31F7BB11EF9A8700FCF3E4 /* test_assembler_unittest */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = test_assembler_unittest; + remoteRef = 8B31F7BA11EF9A8700FCF3E4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; F95BB885101F949F00AA053B /* crash_report */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; @@ -1019,7 +1504,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\necho running minidump generator tests...\n\"${BUILT_PRODUCTS_DIR}/generator_test\"\necho Running exception handler tests...\n\"${BUILT_PRODUCTS_DIR}/handler_test\"\n"; + shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\necho running minidump generator tests...\n\"${BUILT_PRODUCTS_DIR}/generator_test\"\necho Running exception handler tests...\n\"${BUILT_PRODUCTS_DIR}/handler_test\"\necho Running crash generation server tests...\n\"${BUILT_PRODUCTS_DIR}/crash_generation_server_test\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1032,6 +1517,41 @@ F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */, F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */, F92C56340ECD0DF1009BE4BA /* OnDemandServer.mm in Sources */, + D2F9A4CB121336C7002747C1 /* crash_generation_client.cc in Sources */, + D2F9A4CD121336C7002747C1 /* crash_generation_server.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2F9A41212131EF0002747C1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D2F9A43D12131F55002747C1 /* gmock-all.cc in Sources */, + D2F9A44012131F65002747C1 /* gtest_main.cc in Sources */, + D2F9A44112131F65002747C1 /* gtest-all.cc in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2F9A52D121383A1002747C1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D2F9A553121383DC002747C1 /* crash_generation_server_test.cc in Sources */, + D2F9A52E121383A1002747C1 /* crash_generation_client.cc in Sources */, + D2F9A52F121383A1002747C1 /* crash_generation_server.cc in Sources */, + D2F9A530121383A1002747C1 /* MachIPC.mm in Sources */, + D2F9A531121383A1002747C1 /* breakpad_nlist_64.cc in Sources */, + D2F9A532121383A1002747C1 /* dynamic_images.cc in Sources */, + D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */, + D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */, + D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */, + D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */, + D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */, + D2F9A538121383A1002747C1 /* file_id.cc in Sources */, + D2F9A539121383A1002747C1 /* macho_id.cc in Sources */, + D2F9A53A121383A1002747C1 /* macho_utilities.cc in Sources */, + D2F9A53B121383A1002747C1 /* macho_walker.cc in Sources */, + D2F9A53C121383A1002747C1 /* string_utilities.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1078,6 +1598,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D2F9A4DF12133AD9002747C1 /* crash_generation_client.cc in Sources */, + D2F9A4E012133AD9002747C1 /* crash_generation_server.cc in Sources */, + D24BBD291211EDB100F3D417 /* MachIPC.mm in Sources */, D2A5DD401188640400081F03 /* breakpad_nlist_64.cc in Sources */, F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */, F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */, @@ -1109,6 +1632,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D2F9A4E112133AE2002747C1 /* crash_generation_client.cc in Sources */, + D2F9A4E212133AE2002747C1 /* crash_generation_server.cc in Sources */, + D24BBD321212CACF00F3D417 /* MachIPC.mm in Sources */, D2A5DD411188642E00081F03 /* breakpad_nlist_64.cc in Sources */, F93DE3350F82C66B00608B94 /* dynamic_images.cc in Sources */, F93DE3360F82C66B00608B94 /* exception_handler.cc in Sources */, @@ -1121,7 +1647,7 @@ F93DE33D0F82C66B00608B94 /* macho_utilities.cc in Sources */, F93DE33E0F82C66B00608B94 /* macho_walker.cc in Sources */, F93DE33F0F82C66B00608B94 /* string_utilities.cc in Sources */, - F93DE3410F82C68300608B94 /* exception_handler_test.cc in Sources */, + D2F9A3D51212F87C002747C1 /* exception_handler_test.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1149,6 +1675,51 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 8B31023911F0CF0600FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = all_unittests; + targetProxy = 8B31023811F0CF0600FCF3E4 /* PBXContainerItemProxy */; + }; + 8B31051711F1010E00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F93803BD0F80820F004D428B /* generator_test */; + targetProxy = 8B31051611F1010E00FCF3E4 /* PBXContainerItemProxy */; + }; + 8B31051911F1010E00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F93DE2D00F82A67300608B94 /* minidump_file_writer_unittest */; + targetProxy = 8B31051811F1010E00FCF3E4 /* PBXContainerItemProxy */; + }; + 8B31051B11F1010E00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F93DE32B0F82C55600608B94 /* handler_test */; + targetProxy = 8B31051A11F1010E00FCF3E4 /* PBXContainerItemProxy */; + }; + 8B31051D11F1010E00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = macho_dump; + targetProxy = 8B31051C11F1010E00FCF3E4 /* PBXContainerItemProxy */; + }; + 8B31051F11F1010E00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = minidump_upload; + targetProxy = 8B31051E11F1010E00FCF3E4 /* PBXContainerItemProxy */; + }; + D2F9A44312131F80002747C1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2F9A41412131EF0002747C1 /* gtest */; + targetProxy = D2F9A44212131F80002747C1 /* PBXContainerItemProxy */; + }; + D2F9A52B121383A1002747C1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2F9A41412131EF0002747C1 /* gtest */; + targetProxy = D2F9A52C121383A1002747C1 /* PBXContainerItemProxy */; + }; + D2F9A5DF12142A6A002747C1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2F9A52A121383A1002747C1 /* crash_generation_server_test */; + targetProxy = D2F9A5DE12142A6A002747C1 /* PBXContainerItemProxy */; + }; F91AF6380FD60A74009D8BE2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8DC2EF4F0486A6940098B216 /* Breakpad */; @@ -1241,6 +1812,17 @@ isa = PBXVariantGroup; children = ( 33880C7F0F9E097100817F82 /* English */, + DE43468711C7295D004F095F /* da */, + DE43468611C72958004F095F /* de */, + DE43468811C7295F004F095F /* es */, + DE43468911C72964004F095F /* fr */, + DE43468A11C72967004F095F /* it */, + DE43468B11C7296B004F095F /* ja */, + DE43468C11C7296D004F095F /* nl */, + DE43468D11C7296F004F095F /* no */, + DE43468E11C72971004F095F /* sl */, + DE43468F11C72973004F095F /* sv */, + DE43469011C72976004F095F /* tr */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1249,6 +1831,17 @@ isa = PBXVariantGroup; children = ( F945849D0F280E3C009A47BF /* English */, + DE43467411C72855004F095F /* da */, + DE43467511C72857004F095F /* de */, + DE43467611C7285B004F095F /* es */, + DE43467711C72862004F095F /* fr */, + DE43467811C72869004F095F /* it */, + DE43467E11C728DC004F095F /* ja */, + DE43467911C7286D004F095F /* nl */, + DE43467A11C72873004F095F /* no */, + DE43467B11C72877004F095F /* sl */, + DE43467C11C7287A004F095F /* sv */, + DE43467F11C728E1004F095F /* tr */, ); name = Localizable.strings; sourceTree = ""; @@ -1275,18 +1868,12 @@ 1DEB91AE08733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_NAME = Breakpad; @@ -1297,14 +1884,12 @@ 1DEB91AF08733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_NAME = Breakpad; @@ -1314,48 +1899,110 @@ }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)"; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "../..//**"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + }; + name = Release; + }; + D2F9A41612131EF0002747C1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../testing, + ../../testing/include, + ../../testing/gtest, + ../../testing/gtest/include, + ); PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + PRODUCT_NAME = gtest; + }; + name = Debug; + }; + D2F9A41712131EF0002747C1 /* Debug With Code Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + PREBINDING = NO; + PRODUCT_NAME = gtest; + }; + name = "Debug With Code Coverage"; + }; + D2F9A41812131EF0002747C1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PREBINDING = NO; + PRODUCT_NAME = gtest; + ZERO_LINK = NO; + }; + name = Release; + }; + D2F9A543121383A1002747C1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + ../.., + ../../testing, + ../../testing/include, + ../../testing/gtest, + ../../testing/gtest/include, + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/build/Debug\"", + ); + PRODUCT_NAME = crash_generation_server_test; + }; + name = Debug; + }; + D2F9A544121383A1002747C1 /* Debug With Code Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ../..; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\\\"$(SRCROOT)/build/Debug\\\"", + ); + PRODUCT_NAME = handler_test; + }; + name = "Debug With Code Coverage"; + }; + D2F9A545121383A1002747C1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ../..; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\\\"$(SRCROOT)/build/Debug\\\"", + ); + PRODUCT_NAME = handler_test; }; name = Release; }; F92C53560ECCE34A009BE4BA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "$(inherited)", - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = Inspector; }; name = Debug; @@ -1363,45 +2010,22 @@ F92C53570ECCE34A009BE4BA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/bin; - LD_GENERATE_MAP_FILE = YES; - OTHER_LDFLAGS = ( - "$(inherited)", - "-lcrypto", - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = Inspector; - ZERO_LINK = NO; }; name = Release; }; F92C563D0ECD10B3009BE4BA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/lib; + HEADER_SEARCH_PATHS = ../..; LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)"; OTHER_LDFLAGS = ( "$(inherited)", "-headerpad_max_install_names", - "-lcrypto", ); - PREBINDING = NO; PRODUCT_NAME = breakpadUtilities; }; name = Debug; @@ -1409,47 +2033,23 @@ F92C563E0ECD10B3009BE4BA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/lib; + HEADER_SEARCH_PATHS = ../..; LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)"; OTHER_LDFLAGS = ( "$(inherited)", "-headerpad_max_install_names", - "-lcrypto", ); - PREBINDING = NO; PRODUCT_NAME = breakpadUtilities; - ZERO_LINK = NO; }; name = Release; }; F92C56A30ECE04A8009BE4BA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = "sender/crash_report_sender-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = crash_report_sender; }; name = Debug; @@ -1457,181 +2057,94 @@ F92C56A40ECE04A8009BE4BA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = "sender/crash_report_sender-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = crash_report_sender; - ZERO_LINK = NO; }; name = Release; }; F93803C00F808210004D428B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Foundation, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = generator_test; - USER_HEADER_SEARCH_PATHS = ../../; }; name = Debug; }; F93803C10F808210004D428B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Foundation, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = generator_test; - ZERO_LINK = NO; }; name = Release; }; F93DE2D30F82A67400608B94 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_CHAR_IS_UNSIGNED_CHAR = YES; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = minidump_file_writer_unittest; - USER_HEADER_SEARCH_PATHS = ../../; }; name = Debug; }; F93DE2D40F82A67400608B94 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = minidump_file_writer_unittest; - ZERO_LINK = NO; }; name = Release; }; F93DE32E0F82C55700608B94 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Foundation, + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + ../.., + ../../testing, + ../../testing/include, + ../../testing/gtest, + ../../testing/gtest/include, + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/build/Debug\"", ); - PREBINDING = NO; PRODUCT_NAME = handler_test; - USER_HEADER_SEARCH_PATHS = ../../; }; name = Debug; }; F93DE32F0F82C55700608B94 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Foundation, + HEADER_SEARCH_PATHS = ../..; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/build/Debug\"", ); - PREBINDING = NO; PRODUCT_NAME = handler_test; - ZERO_LINK = NO; }; name = Release; }; F93DE3B90F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH)"; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = "Debug With Code Coverage"; }; F93DE3BA0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_NAME = Breakpad; @@ -1642,19 +2155,7 @@ F93DE3BB0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-lcrypto", - "$(inherited)", - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = Inspector; }; name = "Debug With Code Coverage"; @@ -1662,24 +2163,14 @@ F93DE3BC0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; - INSTALL_PATH = /usr/local/lib; + HEADER_SEARCH_PATHS = ../..; LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)"; OTHER_LDFLAGS = ( "$(inherited)", "-headerpad_max_install_names", - "-lcrypto", ); - PREBINDING = NO; PRODUCT_NAME = breakpadUtilities; }; name = "Debug With Code Coverage"; @@ -1687,23 +2178,8 @@ F93DE3BD0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - HEADER_SEARCH_PATHS = "../..//**"; + HEADER_SEARCH_PATHS = ../..; INFOPLIST_FILE = "sender/crash_report_sender-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = crash_report_sender; }; name = "Debug With Code Coverage"; @@ -1711,24 +2187,8 @@ F93DE3BE0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; INFOPLIST_FILE = testapp/Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = BreakpadTest; }; name = "Debug With Code Coverage"; @@ -1736,9 +2196,6 @@ F93DE3BF0F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = All; }; name = "Debug With Code Coverage"; @@ -1746,28 +2203,14 @@ F93DE3C00F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; - INFOPLIST_FILE = "UnitTests-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - LIBRARY_SEARCH_PATHS = ./gcov; - OTHER_LDFLAGS = ( - "-lgcov", - "-framework", - Cocoa, - "-framework", - SenTestingKit, + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", ); - PREBINDING = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + HEADER_SEARCH_PATHS = ../..; + INFOPLIST_FILE = "UnitTests-Info.plist"; PRODUCT_NAME = UnitTests; - USER_HEADER_SEARCH_PATHS = "../../ ../../common/mac/**"; WRAPPER_EXTENSION = octest; }; name = "Debug With Code Coverage"; @@ -1775,86 +2218,34 @@ F93DE3C10F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = ./gcov; - OTHER_LDFLAGS = ( - "-lgcov", - "-lcrypto", - "-framework", - Foundation, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = generator_test; - USER_HEADER_SEARCH_PATHS = ../../; }; name = "Debug With Code Coverage"; }; F93DE3C20F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_CHAR_IS_UNSIGNED_CHAR = YES; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = ./gcov; - OTHER_LDFLAGS = ( - "-lgcov", - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../..; PRODUCT_NAME = minidump_file_writer_unittest; - USER_HEADER_SEARCH_PATHS = ../../; }; name = "Debug With Code Coverage"; }; F93DE3C30F830E7000608B94 /* Debug With Code Coverage */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = ./gcov; - OTHER_LDFLAGS = ( - "-lcrypto", - "-lgcov", - "-framework", - Foundation, + HEADER_SEARCH_PATHS = ../..; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/build/Debug\"", ); - PREBINDING = NO; PRODUCT_NAME = handler_test; - USER_HEADER_SEARCH_PATHS = ../../; }; name = "Debug With Code Coverage"; }; F94585850F782326009A47BF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = All; }; name = Debug; @@ -1862,35 +2253,15 @@ F94585860F782326009A47BF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; PRODUCT_NAME = All; - ZERO_LINK = NO; }; name = Release; }; F9C44DA80EF060A8003AEBAA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; INFOPLIST_FILE = testapp/Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = BreakpadTest; }; name = Debug; @@ -1898,46 +2269,22 @@ F9C44DA90EF060A8003AEBAA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; INFOPLIST_FILE = testapp/Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; PRODUCT_NAME = BreakpadTest; - ZERO_LINK = NO; }; name = Release; }; F9C77DDC0F7DD5D00045F7DB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; - INFOPLIST_FILE = "UnitTests-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-framework", - Cocoa, - "-framework", - SenTestingKit, + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", ); - PREBINDING = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + INFOPLIST_FILE = "UnitTests-Info.plist"; PRODUCT_NAME = UnitTests; - USER_HEADER_SEARCH_PATHS = "../../ ../../common/mac/**"; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -1945,25 +2292,14 @@ F9C77DDD0F7DD5D00045F7DB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = "UnitTests-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-framework", - Cocoa, - "-framework", - SenTestingKit, + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", ); - PREBINDING = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + INFOPLIST_FILE = "UnitTests-Info.plist"; PRODUCT_NAME = UnitTests; WRAPPER_EXTENSION = octest; - ZERO_LINK = NO; }; name = Release; }; @@ -1990,6 +2326,26 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D2F9A42D12131F0E002747C1 /* Build configuration list for PBXNativeTarget "gtest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D2F9A41612131EF0002747C1 /* Debug */, + D2F9A41712131EF0002747C1 /* Debug With Code Coverage */, + D2F9A41812131EF0002747C1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D2F9A542121383A1002747C1 /* Build configuration list for PBXNativeTarget "crash_generation_server_test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D2F9A543121383A1002747C1 /* Debug */, + D2F9A544121383A1002747C1 /* Debug With Code Coverage */, + D2F9A545121383A1002747C1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; F92C53580ECCE36D009BE4BA /* Build configuration list for PBXNativeTarget "Inspector" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h index 6b5ce66ac89..52ea6c6b8ca 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h @@ -110,16 +110,19 @@ typedef bool (*BreakpadFilterCallback)(int exception_type, // Key: Value: // BREAKPAD_PRODUCT Product name (e.g., "MyAwesomeProduct") // This one is used as the key to identify -// the product when uploading +// the product when uploading. Falls back to +// CFBundleName if not specified. // REQUIRED // // BREAKPAD_PRODUCT_DISPLAY This is the display name, e.g. a pretty // name for the product when the crash_sender -// pops up UI for the user. Falls back to +// pops up UI for the user. Falls back first to +// CFBundleDisplayName and then to // BREAKPAD_PRODUCT if not specified. // // BREAKPAD_VERSION Product version (e.g., 1.2.3), used -// as metadata for crash report +// as metadata for crash report. Falls back to +// CFBundleVersion if not specified. // REQUIRED // // BREAKPAD_VENDOR Vendor name, used in UI (e.g. "A report has diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm index 23e5d9bfc6c..12b5f283c83 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm @@ -55,6 +55,10 @@ using google_breakpad::KeyValueEntry; +using google_breakpad::MachPortSender; +using google_breakpad::MachReceiveMessage; +using google_breakpad::MachSendMessage; +using google_breakpad::ReceivePort; using google_breakpad::SimpleStringDictionary; using google_breakpad::SimpleStringDictionaryIterator; @@ -164,7 +168,7 @@ class Breakpad { : handler_(NULL), config_params_(NULL), send_and_exit_(true), - filter_callback_(NULL), + filter_callback_(NULL), filter_callback_context_(NULL) { inspector_path_[0] = 0; } @@ -265,7 +269,7 @@ bool Breakpad::ExceptionHandlerDirectCallback(void *context, //============================================================================= #pragma mark - -#include +#include //============================================================================= // Returns the pathname to the Resources directory for this version of @@ -286,28 +290,21 @@ NSString * GetResourcePath() { // // Get the pathname to the code which contains this function - void *address = nil; - NSModule module = nil; - _dyld_lookup_and_bind_fully("_GetResourcePath", - &address, - &module); - - if (module && address) { - const char* moduleName = NSNameOfModule(module); - if (moduleName) { - // The "Resources" directory should be in the same directory as the - // executable code, since that's how the Breakpad framework is built. - resourcePath = [NSString stringWithUTF8String:moduleName]; - resourcePath = [resourcePath stringByDeletingLastPathComponent]; - resourcePath = [resourcePath stringByAppendingPathComponent:@"Resources/"]; - } else { - DEBUGLOG(stderr, "Missing moduleName\n"); - } + Dl_info info; + if (dladdr((const void*)GetResourcePath, &info) != 0) { + NSFileManager *filemgr = [NSFileManager defaultManager]; + NSString *filePath = + [filemgr stringWithFileSystemRepresentation:info.dli_fname + length:strlen(info.dli_fname)]; + 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 { DEBUGLOG(stderr, "Could not find GetResourcePath\n"); // fallback plan NSBundle *bundle = - [NSBundle bundleWithIdentifier:@"com.Google.BreakpadFramework"]; + [NSBundle bundleWithIdentifier:@"com.Google.BreakpadFramework"]; resourcePath = [bundle resourcePath]; } @@ -371,9 +368,10 @@ bool Breakpad::Initialize(NSDictionary *parameters) { // Create the handler (allocating it in our special protected pool) handler_ = - new (gBreakpadAllocator->Allocate(sizeof(google_breakpad::ExceptionHandler))) - google_breakpad::ExceptionHandler( - Breakpad::ExceptionHandlerDirectCallback, this, true); + new (gBreakpadAllocator->Allocate( + sizeof(google_breakpad::ExceptionHandler))) + google_breakpad::ExceptionHandler( + Breakpad::ExceptionHandlerDirectCallback, this, true); return true; } @@ -403,22 +401,23 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL]; NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL]; NSString *inspectorPathString = - [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION]; + [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION]; NSString *reporterPathString = - [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION]; + [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION]; NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT]; NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES]; - NSString *logFileTailSize = [parameters objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE]; + NSString *logFileTailSize = + [parameters objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE]; NSString *requestUserText = - [parameters objectForKey:@BREAKPAD_REQUEST_COMMENTS]; + [parameters objectForKey:@BREAKPAD_REQUEST_COMMENTS]; NSString *requestEmail = [parameters objectForKey:@BREAKPAD_REQUEST_EMAIL]; NSString *vendor = - [parameters objectForKey:@BREAKPAD_VENDOR]; + [parameters objectForKey:@BREAKPAD_VENDOR]; NSString *dumpSubdirectory = - [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY]; + [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY]; - NSDictionary *serverParameters = - [parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT]; + NSDictionary *serverParameters = + [parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT]; // These may have been set above as user prefs, which take priority. if (!skipConfirm) { @@ -431,8 +430,12 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { if (!product) product = [parameters objectForKey:@"CFBundleName"]; - if (!display) - display = product; + if (!display) { + display = [parameters objectForKey:@"CFBundleDisplayName"]; + if (!display) { + display = product; + } + } if (!version) version = [parameters objectForKey:@"CFBundleVersion"]; @@ -512,8 +515,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { // Find Reporter. if (!reporterPathString) { reporterPathString = - [resourcePath stringByAppendingPathComponent:@"crash_report_sender.app"]; - reporterPathString = [[NSBundle bundleWithPath:reporterPathString] executablePath]; + [resourcePath + stringByAppendingPathComponent:@"crash_report_sender.app"]; + reporterPathString = + [[NSBundle bundleWithPath:reporterPathString] executablePath]; } // Verify that there is a Reporter application. @@ -558,9 +563,9 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { dictionary.SetKeyValue(BREAKPAD_SKIP_CONFIRM, [skipConfirm UTF8String]); dictionary.SetKeyValue(BREAKPAD_CONFIRM_TIMEOUT, [timeout UTF8String]); dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION, - [inspectorPathString fileSystemRepresentation]); + [inspectorPathString fileSystemRepresentation]); dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION, - [reporterPathString fileSystemRepresentation]); + [reporterPathString fileSystemRepresentation]); dictionary.SetKeyValue(BREAKPAD_LOGFILE_UPLOAD_SIZE, [logFileTailSize UTF8String]); dictionary.SetKeyValue(BREAKPAD_REQUEST_COMMENTS, @@ -569,11 +574,11 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { dictionary.SetKeyValue(BREAKPAD_VENDOR, [vendor UTF8String]); dictionary.SetKeyValue(BREAKPAD_DUMP_DIRECTORY, [dumpSubdirectory UTF8String]); - + struct timeval tv; gettimeofday(&tv, NULL); char timeStartedString[32]; - sprintf(timeStartedString, "%d", tv.tv_sec); + sprintf(timeStartedString, "%zd", tv.tv_sec); dictionary.SetKeyValue(BREAKPAD_PROCESS_START_TIME, timeStartedString); @@ -591,7 +596,7 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { // For each key-value pair, call BreakpadAddUploadParameter() NSEnumerator *keyEnumerator = [serverParameters keyEnumerator]; NSString *aParameter; - while (aParameter = [keyEnumerator nextObject]) { + while ((aParameter = [keyEnumerator nextObject])) { BreakpadAddUploadParameter(this, aParameter, [serverParameters objectForKey:aParameter]); } @@ -600,7 +605,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; @@ -609,7 +614,7 @@ void Breakpad::SetKeyValue(NSString *key, NSString *value) { } //============================================================================= -NSString * Breakpad::KeyValue(NSString *key) { +NSString *Breakpad::KeyValue(NSString *key) { if (!config_params_ || !key) return nil; @@ -618,25 +623,24 @@ NSString * Breakpad::KeyValue(NSString *key) { } //============================================================================= -void Breakpad::RemoveKeyValue(NSString *key) { - if (!config_params_ || !key) - return; +void Breakpad::RemoveKeyValue(NSString *key) { + if (!config_params_ || !key) return; config_params_->RemoveKey([key UTF8String]); } //============================================================================= -void Breakpad::GenerateAndSendReport() { +void Breakpad::GenerateAndSendReport() { config_params_->SetKeyValue(BREAKPAD_ON_DEMAND, "YES"); - HandleException(0, 0, 0, mach_thread_self()); + HandleException(0, 0, 0, mach_thread_self()); config_params_->SetKeyValue(BREAKPAD_ON_DEMAND, "NO"); } //============================================================================= -bool Breakpad::HandleException(int exception_type, - int exception_code, - int exception_subcode, - mach_port_t crashing_thread) { +bool Breakpad::HandleException(int exception_type, + int exception_code, + int exception_subcode, + mach_port_t crashing_thread) { DEBUGLOG(stderr, "Breakpad: an exception occurred\n"); if (filter_callback_) { @@ -712,8 +716,7 @@ bool Breakpad::HandleException(int exception_type, // If we don't want any forwarding, return true here to indicate that we've // processed things as much as we want. - if (send_and_exit_) - return true; + if (send_and_exit_) return true; return false; } @@ -739,11 +742,11 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) { // since once it does its allocations and locks the memory, smashes to itself // don't affect anything we care about. gMasterAllocator = - new ProtectedMemoryAllocator(sizeof(ProtectedMemoryAllocator) * 2); + new ProtectedMemoryAllocator(sizeof(ProtectedMemoryAllocator) * 2); gKeyValueAllocator = - new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator))) - ProtectedMemoryAllocator(sizeof(SimpleStringDictionary)); + new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator))) + ProtectedMemoryAllocator(sizeof(SimpleStringDictionary)); // Create a mutex for use in accessing the SimpleStringDictionary int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL); @@ -761,8 +764,8 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) { */ gBreakpadAllocator = - new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator))) - ProtectedMemoryAllocator(breakpad_pool_size); + new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator))) + ProtectedMemoryAllocator(breakpad_pool_size); // Stack-based autorelease pool for Breakpad::Create() obj-c code. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm index 11b126c2eb3..386854602c0 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm @@ -116,7 +116,7 @@ void OnDemandServer::LaunchOnDemand() { // and holding on to this port delays launching until the current process // exits! mach_port_deallocate(mach_task_self(), server_port_); - server_port_ = NULL; + server_port_ = MACH_PORT_DEAD; // Now, the service is still registered and all we need to do is send // a mach message to the service port in order to launch the server. diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm index d328ee5dbf6..a8930858ee5 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm @@ -44,6 +44,8 @@ #import "common/mac/SimpleStringDictionary.h" #import "common/mac/MachIPC.h" +#import "GTMDefines.h" + #import #if VERBOSE @@ -91,14 +93,14 @@ static BOOL EnsureDirectoryPathExists(NSString *dirPath) { // Break up the difference into components NSString *diff = [dirPath substringFromIndex:[common length] + 1]; NSArray *components = [diff pathComponents]; - unsigned count = [components count]; + NSUInteger count = [components count]; // Rebuild the path one component at a time NSDictionary *attrs = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:0750] forKey:NSFilePosixPermissions]; path = common; - for (unsigned i = 0; i < count; ++i) { + for (NSUInteger i = 0; i < count; ++i) { path = [path stringByAppendingPathComponent:[components objectAtIndex:i]]; if (![mgr createDirectoryAtPath:path attributes:attrs]) @@ -329,12 +331,12 @@ kern_return_t Inspector::ReadMessages() { // we are expected to read. // Read each key/value pair, one mach message per key/value pair. for (unsigned int i = 0; i < info.parameter_count; ++i) { - MachReceiveMessage message; - result = receive_port.WaitForMessage(&message, 1000); + MachReceiveMessage parameter_message; + result = receive_port.WaitForMessage(¶meter_message, 1000); if(result == KERN_SUCCESS) { KeyValueMessageData &key_value_data = - (KeyValueMessageData&)*message.GetData(); + (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 // many times in a short period of time) caused the Mach IPC @@ -376,11 +378,11 @@ void Inspector::SetCrashTimeParameters() { if (processStartTimeString) { time_t processStartTime = strtol(processStartTimeString, NULL, 10); time_t processUptime = tv.tv_sec - processStartTime; - sprintf(processUptimeString, "%d", processUptime); + sprintf(processUptimeString, "%zd", processUptime); config_params_.SetKeyValue(BREAKPAD_PROCESS_UP_TIME, processUptimeString); } - sprintf(processCrashtimeString, "%d", tv.tv_sec); + sprintf(processCrashtimeString, "%zd", tv.tv_sec); config_params_.SetKeyValue(BREAKPAD_PROCESS_CRASH_TIME, processCrashtimeString); } diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h new file mode 100644 index 00000000000..a3a95dcaced --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h @@ -0,0 +1,47 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ +#define CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ + +namespace google_breakpad { + +class ClientInfo { + public: + explicit ClientInfo(pid_t pid) : pid_(pid) {} + + pid_t pid() const { return pid_; } + + private: + pid_t pid_; +}; + +} // namespace google_breakpad + +#endif // CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc new file mode 100644 index 00000000000..0742887669d --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc @@ -0,0 +1,73 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/mac/crash_generation/crash_generation_client.h" + +#include "client/mac/crash_generation/crash_generation_server.h" +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +bool CrashGenerationClient::RequestDumpForException( + int exception_type, + int exception_code, + int exception_subcode, + mach_port_t crashing_thread) { + // The server will send a message to this port indicating that it + // has finished its work. + ReceivePort acknowledge_port; + + MachSendMessage message(kDumpRequestMessage); + message.AddDescriptor(mach_task_self()); // this task + message.AddDescriptor(crashing_thread); // crashing thread + message.AddDescriptor(mach_thread_self()); // handler thread + message.AddDescriptor(acknowledge_port.GetPort()); // message receive port + + ExceptionInfo info; + info.exception_type = exception_type; + info.exception_code = exception_code; + info.exception_subcode = exception_subcode; + message.SetData(&info, sizeof(info)); + + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + kern_return_t result = sender_.SendMessage(message, kSendTimeoutMs); + if (result != KERN_SUCCESS) + return false; + + // Give the server slightly longer to reply since it has to + // inspect this task and write the minidump. + const mach_msg_timeout_t kReceiveTimeoutMs = 5 * 1000; + MachReceiveMessage acknowledge_message; + result = acknowledge_port.WaitForMessage(&acknowledge_message, + kReceiveTimeoutMs); + + return result == KERN_SUCCESS; +} + +} // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h new file mode 100644 index 00000000000..527f577a517 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h @@ -0,0 +1,65 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ +#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ + +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +class CrashGenerationClient { + public: + explicit CrashGenerationClient(const char* mach_port_name) + : sender_(mach_port_name) { + } + + // Request the crash server to generate a dump. + // + // Return true if the dump was successful; false otherwise. + bool RequestDumpForException(int exception_type, + int exception_code, + int exception_subcode, + mach_port_t crashing_thread); + + bool RequestDump() { + return RequestDumpForException(0, 0, 0, MACH_PORT_NULL); + } + + private: + MachPortSender sender_; + + // Prevent copy construction and assignment. + CrashGenerationClient(const CrashGenerationClient&); + CrashGenerationClient& operator=(const CrashGenerationClient&); +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc new file mode 100644 index 00000000000..44548ef0ebd --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc @@ -0,0 +1,160 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/mac/crash_generation/crash_generation_server.h" + +#include "client/mac/crash_generation/client_info.h" +#include "client/mac/handler/minidump_generator.h" +#include "common/mac/scoped_task_suspend-inl.h" + +namespace google_breakpad { + +CrashGenerationServer::CrashGenerationServer( + const char *mach_port_name, + OnClientDumpRequestCallback dump_callback, + void *dump_context, + OnClientExitingCallback exit_callback, + void *exit_context, + bool generate_dumps, + const std::string &dump_path) + : dump_callback_(dump_callback), + dump_context_(dump_context), + exit_callback_(exit_callback), + exit_context_(exit_context), + generate_dumps_(generate_dumps), + dump_dir_(dump_path.empty() ? "/tmp" : dump_path), + started_(false), + receive_port_(mach_port_name), + mach_port_name_(mach_port_name) { +} + +CrashGenerationServer::~CrashGenerationServer() { + if (started_) + Stop(); +} + +bool CrashGenerationServer::Start() { + int thread_create_result = pthread_create(&server_thread_, NULL, + &WaitForMessages, this); + started_ = thread_create_result == 0; + return started_; +} + +bool CrashGenerationServer::Stop() { + if (!started_) + return false; + + // Send a quit message to the background thread, and then join it. + MachPortSender sender(mach_port_name_.c_str()); + MachSendMessage quit_message(kQuitMessage); + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + kern_return_t result = sender.SendMessage(quit_message, kSendTimeoutMs); + if (result == KERN_SUCCESS) { + int thread_join_result = pthread_join(server_thread_, NULL); + started_ = thread_join_result != 0; + } + + return !started_; +} + +// static +void *CrashGenerationServer::WaitForMessages(void *server) { + CrashGenerationServer *self = + reinterpret_cast(server); + while (self->WaitForOneMessage()) {} + return NULL; +} + +bool CrashGenerationServer::WaitForOneMessage() { + MachReceiveMessage message; + kern_return_t result = receive_port_.WaitForMessage(&message, + MACH_MSG_TIMEOUT_NONE); + if (result == KERN_SUCCESS) { + switch (message.GetMessageID()) { + case kDumpRequestMessage: { + ExceptionInfo &info = (ExceptionInfo &)*message.GetData(); + + mach_port_t remote_task = message.GetTranslatedPort(0); + mach_port_t crashing_thread = message.GetTranslatedPort(1); + mach_port_t handler_thread = message.GetTranslatedPort(2); + mach_port_t ack_port = message.GetTranslatedPort(3); + pid_t remote_pid = -1; + pid_for_task(remote_task, &remote_pid); + ClientInfo client(remote_pid); + + bool result; + std::string dump_path; + if (generate_dumps_) { + ScopedTaskSuspend suspend(remote_task); + + MinidumpGenerator generator(remote_task, handler_thread); + dump_path = generator.UniqueNameInDirectory(dump_dir_, NULL); + + if (info.exception_type && info.exception_code) { + generator.SetExceptionInformation(info.exception_type, + info.exception_code, + info.exception_subcode, + crashing_thread); + } + result = generator.Write(dump_path.c_str()); + } else { + result = true; + } + + if (result && dump_callback_) { + dump_callback_(dump_context_, client, dump_path); + } + + // TODO(ted): support a way for the client to send additional data, + // perhaps with a callback so users of the server can read the data + // themselves? + + if (ack_port != MACH_PORT_DEAD && ack_port != MACH_PORT_NULL) { + MachPortSender sender(ack_port); + MachSendMessage ack_message(kAcknowledgementMessage); + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + + sender.SendMessage(ack_message, kSendTimeoutMs); + } + + if (exit_callback_) { + exit_callback_(exit_context_, client); + } + break; + } + case kQuitMessage: + return false; + } + } else { // result != KERN_SUCCESS + return false; + } + return true; +} + +} // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h new file mode 100644 index 00000000000..e174f9d0da0 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h @@ -0,0 +1,139 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ +#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ + +#include + +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +class ClientInfo; + +// Messages the server can read via its mach port +enum { + kDumpRequestMessage = 1, + kAcknowledgementMessage = 2, + kQuitMessage = 3 +}; + +// Exception details sent by the client when requesting a dump. +struct ExceptionInfo { + int exception_type; + int exception_code; + int exception_subcode; +}; + +class CrashGenerationServer { + public: + // 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 (*OnClientExitingCallback)(void *context, + const ClientInfo &client_info); + + // Create an instance with the given parameters. + // + // mach_port_name: Named server port to listen on. + // dump_callback: Callback for a client crash dump request. + // dump_context: Context for client crash dump request callback. + // exit_callback: Callback for client process exit. + // exit_context: Context for client exit callback. + // generate_dumps: Whether to automatically generate dumps. + // Client code of this class might want to generate dumps explicitly + // in the crash dump request callback. In that case, false can be + // 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, + OnClientDumpRequestCallback dump_callback, + void *dump_context, + OnClientExitingCallback exit_callback, + void *exit_context, + bool generate_dumps, + const std::string &dump_path); + + ~CrashGenerationServer(); + + // Perform initialization steps needed to start listening to clients. + // + // Return true if initialization is successful; false otherwise. + bool Start(); + + // Stop the server. + bool Stop(); + + private: + // Return a unique filename at which a minidump can be written. + bool MakeMinidumpFilename(std::string &outFilename); + + // Loop reading client messages and responding to them until + // a quit message is received. + 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(); + + OnClientDumpRequestCallback dump_callback_; + void *dump_context_; + + OnClientExitingCallback exit_callback_; + void *exit_context_; + + bool generate_dumps_; + + std::string dump_dir_; + + bool started_; + + // The mach port that receives requests to dump from child processes. + ReceivePort receive_port_; + + // The name of the mach port. Stored so the Stop method can message + // the background thread to shut it down. + std::string mach_port_name_; + + // The thread that waits on the receive port. + pthread_t server_thread_; + + // Disable copy constructor and operator=. + CrashGenerationServer(const CrashGenerationServer&); + CrashGenerationServer& operator=(const CrashGenerationServer&); +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc index c220d88dd1d..4b655c79366 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc @@ -137,7 +137,7 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { breakpad_nlist space[BUFSIZ/sizeof (breakpad_nlist)]; const register char *s1, *s2; - register int n, m; + register register_t n, m; int maxlen, nreq; off_t sa; /* symbol address */ off_t ss; /* start of strings */ @@ -160,14 +160,14 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { (N_BADMAG(buf) && *((long *)&buf) != MH_MAGIC && NXSwapBigLongToHost(*((long *)&buf)) != FAT_MAGIC) && /* nealsid: The following is the big-endian ppc64 check */ - (*((uint32_t*)&buf)) != FAT_MAGIC) { + (*((long*)&buf)) != FAT_MAGIC) { return (-1); } /* Deal with fat file if necessary */ if (NXSwapBigLongToHost(*((long *)&buf)) == FAT_MAGIC || /* nealsid: The following is the big-endian ppc64 check */ - *((int*)&buf) == FAT_MAGIC) { + *((unsigned int *)&buf) == FAT_MAGIC) { struct host_basic_info hbi; struct fat_header fh; struct fat_arch *fat_archs, *fap; @@ -191,7 +191,7 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { } /* Convert fat_narchs to host byte order */ - fh.nfat_arch = NXSwapBigLongToHost(fh.nfat_arch); + fh.nfat_arch = NXSwapBigIntToHost(fh.nfat_arch); /* Read in the fat archs */ fat_archs = (struct fat_arch *)malloc(fh.nfat_arch * @@ -201,7 +201,7 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { } if (read(fd, (char *)fat_archs, sizeof(struct fat_arch) * fh.nfat_arch) != - sizeof(struct fat_arch) * fh.nfat_arch) { + (ssize_t)sizeof(struct fat_arch) * fh.nfat_arch) { free(fat_archs); return (-1); } @@ -212,15 +212,15 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { */ for (i = 0; i < fh.nfat_arch; i++) { fat_archs[i].cputype = - NXSwapBigLongToHost(fat_archs[i].cputype); + NXSwapBigIntToHost(fat_archs[i].cputype); fat_archs[i].cpusubtype = - NXSwapBigLongToHost(fat_archs[i].cpusubtype); + NXSwapBigIntToHost(fat_archs[i].cpusubtype); fat_archs[i].offset = - NXSwapBigLongToHost(fat_archs[i].offset); + NXSwapBigIntToHost(fat_archs[i].offset); fat_archs[i].size = - NXSwapBigLongToHost(fat_archs[i].size); + NXSwapBigIntToHost(fat_archs[i].size); fat_archs[i].align = - NXSwapBigLongToHost(fat_archs[i].align); + NXSwapBigIntToHost(fat_archs[i].align); } fap = NULL; @@ -257,7 +257,7 @@ __breakpad_fdnlist_64(int fd, breakpad_nlist *list, const char **symbolNames) { } } - if (*((int *)&buf) == MH_MAGIC_64) { + if (*((unsigned int *)&buf) == MH_MAGIC_64) { struct mach_header_64 mh; struct load_command *load_commands, *lcp; struct symtab_command *stp; diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc index 6af3e931db0..1d5f1f9bd8e 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc @@ -34,6 +34,7 @@ extern "C" { // needed to compile on Leopard } #include "breakpad_nlist_64.h" +#include #include #include #include @@ -129,7 +130,7 @@ static void* ReadTaskString(task_port_t target_task, size_to_end > kMaxStringLength ? kMaxStringLength : size_to_end; kern_return_t kr; - return ReadTaskMemory(target_task, address, size_to_read, &kr); + return ReadTaskMemory(target_task, address, (size_t)size_to_read, &kr); } return NULL; @@ -276,13 +277,11 @@ void DynamicImage::Print() { //============================================================================== // Loads information about dynamically loaded code in the given task. DynamicImages::DynamicImages(mach_port_t task) - : task_(task) { + : task_(task), image_list_() { ReadImageInfoForTask(); } -void* DynamicImages::GetDyldAllImageInfosPointer() -{ - +void* DynamicImages::GetDyldAllImageInfosPointer() { const char *imageSymbolName = "_dyld_all_image_infos"; const char *dyldPath = "/usr/lib/dyld"; #ifndef __LP64__ @@ -298,6 +297,8 @@ void* DynamicImages::GetDyldAllImageInfosPointer() if(list.n_value) { return reinterpret_cast(list.n_value); } + + return NULL; #else struct nlist_64 l[8]; struct nlist_64 &list = l[0]; @@ -311,11 +312,10 @@ void* DynamicImages::GetDyldAllImageInfosPointer() if(invalidEntriesCount != 0) { return NULL; } - if (list.n_value) { - return reinterpret_cast(list.n_value); - } + assert(list.n_value); + return reinterpret_cast(list.n_value); #endif - return NULL; + } //============================================================================== // This code was written using dyld_debug.c (from Darwin) as a guide. @@ -363,7 +363,7 @@ void DynamicImages::ReadImageInfoForTask() { // Now determine the total amount we really want to read based on the // size of the load commands. We need the header plus all of the // load commands. - unsigned int header_size = + size_t header_size = sizeof(breakpad_mach_header) + header->sizeofcmds; free(header); diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h index 85ba8cf99ad..72eb221b06d 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h @@ -103,7 +103,7 @@ class MachHeader { class DynamicImage { public: DynamicImage(breakpad_mach_header *header, // we take ownership - int header_size, // includes load commands + size_t header_size, // includes load commands breakpad_mach_header *load_address, char *inFilePath, uintptr_t image_mod_date, @@ -111,6 +111,11 @@ class DynamicImage { : header_(header), header_size_(header_size), load_address_(load_address), + vmaddr_(0), + vmsize_(0), + slide_(0), + version_(0), + file_path_(NULL), file_mod_date_(image_mod_date), task_(task) { InitializeFilePath(inFilePath); @@ -128,7 +133,7 @@ class DynamicImage { breakpad_mach_header *GetMachHeader() {return header_;} // Size of mach_header plus load commands - int GetHeaderSize() const {return header_size_;} + size_t GetHeaderSize() const {return header_size_;} // Full path to mach-o binary char *GetFilePath() {return file_path_;} @@ -158,8 +163,11 @@ class DynamicImage { // Debugging void Print(); - + private: + DynamicImage(const DynamicImage &); + DynamicImage &operator=(const DynamicImage &); + friend class DynamicImages; // Sanity checking @@ -180,7 +188,7 @@ class DynamicImage { void CalculateMemoryAndVersionInfo(); breakpad_mach_header *header_; // our local copy of the header - int header_size_; // mach_header plus load commands + size_t header_size_; // mach_header plus load commands breakpad_mach_header *load_address_; // base address image is mapped into mach_vm_address_t vmaddr_; mach_vm_size_t vmsize_; @@ -231,13 +239,13 @@ class DynamicImages { explicit DynamicImages(mach_port_t task); ~DynamicImages() { - for (int i = 0; i < (int)image_list_.size(); ++i) { + for (int i = 0; i < GetImageCount(); ++i) { delete image_list_[i]; } } // Returns the number of dynamically loaded mach-o images. - int GetImageCount() const {return image_list_.size();} + int GetImageCount() const {return static_cast(image_list_.size());} // Returns an individual image. DynamicImage *GetImage(int i) { @@ -256,14 +264,14 @@ class DynamicImages { // Debugging void Print() { - for (int i = 0; i < (int)image_list_.size(); ++i) { + for (int i = 0; i < GetImageCount(); ++i) { image_list_[i]->Print(); } } void TestPrint() { const breakpad_mach_header *header; - for (int i = 0; i < (int)image_list_.size(); ++i) { + for (int i = 0; i < GetImageCount(); ++i) { printf("dyld: %p: name = %s\n", _dyld_get_image_header(i), _dyld_get_image_name(i) ); diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc index 9886a5293d7..89cc4e90c6b 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc @@ -33,6 +33,7 @@ #include "client/mac/handler/exception_handler.h" #include "client/mac/handler/minidump_generator.h" #include "common/mac/macho_utilities.h" +#include "common/mac/scoped_task_suspend-inl.h" #ifndef USE_PROTECTED_ALLOCATIONS #define USE_PROTECTED_ALLOCATIONS 0 @@ -221,7 +222,8 @@ ExceptionHandler::ExceptionHandler(const string &dump_path, FilterCallback filter, MinidumpCallback callback, void *callback_context, - bool install_handler) + bool install_handler, + const char *port_name) : dump_path_(), filter_(filter), callback_(callback), @@ -237,6 +239,8 @@ ExceptionHandler::ExceptionHandler(const string &dump_path, // This will update to the ID and C-string pointers set_dump_path(dump_path); MinidumpGenerator::GatherSystemInformation(); + if (port_name) + crash_generation_client_.reset(new CrashGenerationClient(port_name)); Setup(install_handler); } @@ -293,10 +297,42 @@ bool ExceptionHandler::WriteMinidump() { bool ExceptionHandler::WriteMinidump(const string &dump_path, MinidumpCallback callback, void *callback_context) { - ExceptionHandler handler(dump_path, NULL, callback, callback_context, false); + ExceptionHandler handler(dump_path, NULL, callback, callback_context, false, + NULL); return handler.WriteMinidump(); } +// static +bool ExceptionHandler::WriteMinidumpForChild(mach_port_t child, + mach_port_t child_blamed_thread, + const string &dump_path, + MinidumpCallback callback, + void *callback_context) { + ScopedTaskSuspend suspend(child); + + MinidumpGenerator generator(child, MACH_PORT_NULL); + string dump_id; + string dump_filename = generator.UniqueNameInDirectory(dump_path, &dump_id); + + generator.SetExceptionInformation(EXC_BREAKPOINT, +#if defined (__i386__) || defined(__x86_64__) + EXC_I386_BPT, +#elif defined (__ppc__) || defined (__ppc64__) + EXC_PPC_BREAKPOINT, +#else + #error architecture not supported +#endif + 0, + child_blamed_thread); + bool result = generator.Write(dump_filename.c_str()); + + if (callback) { + return callback(dump_path.c_str(), dump_id.c_str(), + callback_context, result); + } + return result; +} + bool ExceptionHandler::WriteMinidumpWithException(int exception_type, int exception_code, int exception_subcode, @@ -312,6 +348,18 @@ bool ExceptionHandler::WriteMinidumpWithException(int exception_type, if (exception_type && exception_code) _exit(exception_type); } + } else if (IsOutOfProcess()) { + if (exception_type && exception_code) { + // If this is a real exception, give the filter (if any) a chance to + // decide if this should be sent. + if (filter_ && !filter_(callback_context_)) + return false; + return crash_generation_client_->RequestDumpForException( + exception_type, + exception_code, + exception_subcode, + thread_name); + } } else { string minidump_id; @@ -321,7 +369,7 @@ bool ExceptionHandler::WriteMinidumpWithException(int exception_type, MinidumpGenerator md; if (exception_type && exception_code) { // If this is a real exception, give the filter (if any) a chance to - // decided if this should be sent + // decide if this should be sent. if (filter_ && !filter_(callback_context_)) return false; @@ -453,10 +501,11 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) { // Wait for the exception info while (1) { receive.header.msgh_local_port = self->handler_port_; - receive.header.msgh_size = sizeof(receive); + receive.header.msgh_size = static_cast(sizeof(receive)); kern_return_t result = mach_msg(&(receive.header), MACH_RCV_MSG | MACH_RCV_LARGE, 0, - sizeof(receive), self->handler_port_, + receive.header.msgh_size, + self->handler_port_, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h index 896eecda7d9..76353255557 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h @@ -40,6 +40,9 @@ #include +#include "client/mac/crash_generation/crash_generation_client.h" +#include "processor/scoped_ptr.h" + namespace google_breakpad { using std::string; @@ -86,9 +89,12 @@ 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. + // If port_name is non-NULL, attempt to perform out-of-process dump generation + // If port_name is NULL, in-process dump generation will be used. ExceptionHandler(const string &dump_path, FilterCallback filter, MinidumpCallback callback, - void *callback_context, bool install_handler); + 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. @@ -115,6 +121,19 @@ class ExceptionHandler { static bool WriteMinidump(const string &dump_path, MinidumpCallback callback, 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); + + // Returns whether out-of-process dump generation is used or not. + bool IsOutOfProcess() const { + return crash_generation_client_.get() != NULL; + } + private: // Install the mach exception handler bool InstallHandler(); @@ -206,6 +225,9 @@ class ExceptionHandler { // True, if we're using the mutext to indicate when mindump writing occurs bool use_minidump_write_mutex_; + + // Client for out-of-process dump generation. + scoped_ptr crash_generation_client_; }; } // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler_test.cc deleted file mode 100644 index 0a1ecbe7b07..00000000000 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler_test.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -g++ -framework CoreFoundation -I../../.. ../../minidump_file_writer.cc ../../../common/convert_UTF.c ../../../common/string_conversion.cc ../../../common/mac/string_utilities.cc exception_handler.cc minidump_generator.cc exception_handler_test.cc -o exception_handler_test -mmacosx-version-min=10.4 ../../../common/mac/file_id.cc dynamic_images.cc ../../../common/mac/macho_id.cc ../../../common/mac/macho_walker.cc -lcrypto ../../../common/mac/macho_utilities.cc -*/ - -#include -#include -#include - -#include - -#include "exception_handler.h" -#include "minidump_generator.h" - -using std::string; -using google_breakpad::ExceptionHandler; - -static void *SleepyFunction(void *) { - while (1) { - sleep(10000); - } - return NULL; -} - -static void Crasher() { - int *a = (int*)0x42; - - fprintf(stdout, "Going to crash...\n"); - fprintf(stdout, "A = %d", *a); -} - -static void SoonToCrash() { - Crasher(); -} - -bool MDCallback(const char *dump_dir, const char *file_name, - void *context, bool success) { - string path(dump_dir); - string dest(dump_dir); - path.append(file_name); - path.append(".dmp"); - - fprintf(stdout, "Minidump: %s\n", path.c_str()); - // Indicate that we've handled the callback - exit(0); -} - -int main(int argc, char * const argv[]) { - char buffer[PATH_MAX]; - - // Home dir - snprintf(buffer, sizeof(buffer), "/tmp/"); - - string path(buffer); - ExceptionHandler eh(path, NULL, MDCallback, NULL, true); - pthread_t t; - - if (pthread_create(&t, NULL, SleepyFunction, NULL) == 0) { - pthread_detach(t); - } else { - perror("pthread_create"); - } - -// // Dump a test -// eh.WriteMinidump(); - - // Test the handler - SoonToCrash(); - - return 0; -} diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc index f6d0638ccc7..0c54cf42f0f 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc @@ -57,7 +57,8 @@ namespace google_breakpad { // constructor when generating from within the crashed process MinidumpGenerator::MinidumpGenerator() - : exception_type_(0), + : writer_(), + exception_type_(0), exception_code_(0), exception_subcode_(0), exception_thread_(0), @@ -71,12 +72,14 @@ MinidumpGenerator::MinidumpGenerator() // crashed process MinidumpGenerator::MinidumpGenerator(mach_port_t crashing_task, mach_port_t handler_thread) - : exception_type_(0), + : writer_(), + exception_type_(0), exception_code_(0), exception_subcode_(0), exception_thread_(0), crashing_task_(crashing_task), - handler_thread_(handler_thread) { + handler_thread_(handler_thread), + dynamic_images_(NULL) { if (crashing_task != mach_task_self()) { dynamic_images_ = new DynamicImages(crashing_task_); } else { @@ -191,7 +194,7 @@ bool MinidumpGenerator::Write(const char *path) { if (!header.Allocate()) return false; - int writer_count = sizeof(writers) / sizeof(writers[0]); + int writer_count = static_cast(sizeof(writers) / sizeof(writers[0])); // If we don't have exception information, don't write out the // exception stream @@ -355,7 +358,7 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, #define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a) #define AddGPR(a) context_ptr->gpr[a] = REGISTER_FROM_THREADSTATE(machine_state, r ## a) - + AddReg(srr0); AddReg(cr); AddReg(xer); @@ -488,7 +491,7 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, // not used in the flags register. Since the minidump format // specifies 32 bits for the flags register, we can truncate safely // with no loss. - context_ptr->eflags = machine_state->__rflags; + context_ptr->eflags = static_cast(machine_state->__rflags); AddReg(cs); AddReg(fs); AddReg(gs); @@ -502,7 +505,8 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id, MDRawThread *thread) { breakpad_thread_state_data_t state; - mach_msg_type_number_t state_count = sizeof(state); + mach_msg_type_number_t state_count + = static_cast(sizeof(state)); if (thread_get_state(thread_id, BREAKPAD_MACHINE_THREAD_STATE, state, &state_count) == @@ -532,7 +536,10 @@ bool MinidumpGenerator::WriteThreadListStream( return false; // Don't include the generator thread - non_generator_thread_count = thread_count - 1; + if (handler_thread_ != MACH_PORT_NULL) + non_generator_thread_count = thread_count - 1; + else + non_generator_thread_count = thread_count; if (!list.AllocateObjectAndArray(non_generator_thread_count, sizeof(MDRawThread))) return false; @@ -577,7 +584,8 @@ MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) { exception_ptr->exception_record.exception_flags = exception_code_; breakpad_thread_state_data_t state; - mach_msg_type_number_t stateCount = sizeof(state); + mach_msg_type_number_t stateCount + = static_cast(sizeof(state)); if (thread_get_state(exception_thread_, BREAKPAD_MACHINE_THREAD_STATE, @@ -727,7 +735,7 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index, return false; module->base_of_image = image->GetVMAddr() + image->GetVMAddrSlide(); - module->size_of_image = image->GetVMSize(); + module->size_of_image = static_cast(image->GetVMSize()); module->module_name_rva = string_location.rva; // We'll skip the executable module, because they don't have @@ -794,7 +802,7 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index, return false; module->base_of_image = seg->vmaddr + slide; - module->size_of_image = seg->vmsize; + module->size_of_image = static_cast(seg->vmsize); module->module_name_rva = string_location.rva; if (!WriteCVRecord(module, cpu_type, name)) @@ -931,7 +939,7 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { misc_info_stream->location = info.location(); MDRawMiscInfo *info_ptr = info.get(); - info_ptr->size_of_info = sizeof(MDRawMiscInfo); + info_ptr->size_of_info = static_cast(sizeof(MDRawMiscInfo)); info_ptr->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID | MD_MISCINFO_FLAGS1_PROCESS_TIMES | MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO; @@ -943,33 +951,38 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) != -1) { // Omit the fractional time since the MDRawMiscInfo only wants seconds - info_ptr->process_user_time = usage.ru_utime.tv_sec; - info_ptr->process_kernel_time = usage.ru_stime.tv_sec; + info_ptr->process_user_time = + static_cast(usage.ru_utime.tv_sec); + info_ptr->process_kernel_time = + static_cast(usage.ru_stime.tv_sec); } int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, info_ptr->process_id }; + u_int mibsize = static_cast(sizeof(mib) / sizeof(mib[0])); size_t size; - if (!sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &size, NULL, 0)) { + if (!sysctl(mib, mibsize, NULL, &size, NULL, 0)) { mach_vm_address_t addr; if (mach_vm_allocate(mach_task_self(), &addr, size, true) == KERN_SUCCESS) { struct kinfo_proc *proc = (struct kinfo_proc *)addr; - if (!sysctl(mib, sizeof(mib) / sizeof(mib[0]), proc, &size, NULL, 0)) - info_ptr->process_create_time = proc->kp_proc.p_starttime.tv_sec; + if (!sysctl(mib, mibsize, proc, &size, NULL, 0)) + info_ptr->process_create_time = + static_cast(proc->kp_proc.p_starttime.tv_sec); mach_vm_deallocate(mach_task_self(), addr, size); } } // Speed uint64_t speed; + const uint64_t kOneMillion = 1000 * 1000; size = sizeof(speed); sysctlbyname("hw.cpufrequency_max", &speed, &size, NULL, 0); - info_ptr->processor_max_mhz = speed / (1000 * 1000); - info_ptr->processor_mhz_limit = speed / (1000 * 1000); + info_ptr->processor_max_mhz = static_cast(speed / kOneMillion); + info_ptr->processor_mhz_limit = static_cast(speed / kOneMillion); size = sizeof(speed); sysctlbyname("hw.cpufrequency", &speed, &size, NULL, 0); - info_ptr->processor_current_mhz = speed / (1000 * 1000); + info_ptr->processor_current_mhz = static_cast(speed / kOneMillion); return true; } diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj index 996ff42e75e..b140a71a282 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj @@ -3,10 +3,24 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ + 8BFC813F11FF9A58002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814411FF9A9C002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814511FF9A9D002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814811FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814911FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814A11FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; }; + 8BFC814B11FF9B3F002CB4DC /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */; }; + 8BFC814C11FF9B3F002CB4DC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */; }; + 8BFC81A211FF9C2E002CB4DC /* CPlusTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */; }; + 8BFC81A311FF9C2F002CB4DC /* CPlusTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */; }; + 8BFC81AD11FF9C8A002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; }; + 8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; }; + 8BFC81AF11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; }; + 8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; }; 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; }; 9B35FF5B0B267D5F008DE8C7 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; }; 9B37CEEC0AF98ECD00FA4BD4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */; }; @@ -94,12 +108,18 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8BFC812011FF99D5002CB4DC /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; }; + 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; }; + 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; }; + 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; + 8BFC815411FF9B7F002CB4DC /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CPlusTest.framework; path = Library/Frameworks/CPlusTest.framework; sourceTree = DEVELOPER_DIR; }; 8DD76F6C0486A84900D96B5E /* generator_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = generator_test; sourceTree = BUILT_PRODUCTS_DIR; }; 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ../../../common/convert_UTF.c; sourceTree = SOURCE_ROOT; }; 9B35FF570B267D5F008DE8C7 /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ../../../common/convert_UTF.h; sourceTree = SOURCE_ROOT; }; 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ../../../common/string_conversion.cc; sourceTree = SOURCE_ROOT; }; 9B35FF590B267D5F008DE8C7 /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ../../../common/string_conversion.h; sourceTree = SOURCE_ROOT; }; - 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 9B7CA84E0B1297F200CD3A1D /* unit_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = unit_test; sourceTree = BUILT_PRODUCTS_DIR; }; 9B7CA8530B12989000CD3A1D /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer_unittest.cc; path = ../../minidump_file_writer_unittest.cc; sourceTree = ""; }; 9BD82A9B0B00267E0055103E /* handler_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = handler_test; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -132,11 +152,11 @@ F9721F310E8B07E800D7E813 /* dwarftests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dwarftests.mm; sourceTree = ""; }; F9721F380E8B0CFC00D7E813 /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; }; F9721F390E8B0D0D00D7E813 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = SOURCE_ROOT; }; - F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; F9721F760E8B0DC700D7E813 /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; }; F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; }; F9721F780E8B0DC700D7E813 /* functioninfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = functioninfo.cc; path = ../../../common/dwarf/functioninfo.cc; sourceTree = SOURCE_ROOT; }; - F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = /System/Library/Frameworks/SenTestingKit.framework; sourceTree = ""; }; + F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; F9721FA80E8B0E4800D7E813 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ../../../common/md5.c; sourceTree = SOURCE_ROOT; }; F982089A0DB3280D0017AECA /* breakpad_nlist_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakpad_nlist_test.h; sourceTree = ""; }; F982089B0DB3280D0017AECA /* breakpad_nlist_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = breakpad_nlist_test.cc; sourceTree = ""; }; @@ -156,6 +176,7 @@ buildActionMask = 2147483647; files = ( 9B37CEEC0AF98ECD00FA4BD4 /* CoreFoundation.framework in Frameworks */, + 8BFC813F11FF9A58002CB4DC /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -163,6 +184,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8BFC814511FF9A9D002CB4DC /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -171,6 +193,7 @@ buildActionMask = 2147483647; files = ( 9BD82AC10B0029DF0055103E /* CoreFoundation.framework in Frameworks */, + 8BFC814411FF9A9C002CB4DC /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -178,6 +201,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8BFC814A11FF9B13002CB4DC /* libcrypto.dylib in Frameworks */, + 8BFC814B11FF9B3F002CB4DC /* SenTestingKit.framework in Frameworks */, + 8BFC814C11FF9B3F002CB4DC /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -185,6 +211,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8BFC814811FF9B13002CB4DC /* libcrypto.dylib in Frameworks */, + 8BFC81A211FF9C2E002CB4DC /* CPlusTest.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -194,6 +222,8 @@ files = ( F9721F6C0E8B0D7000D7E813 /* Cocoa.framework in Frameworks */, F9721FA20E8B0E2300D7E813 /* SenTestingKit.framework in Frameworks */, + 8BFC814911FF9B13002CB4DC /* libcrypto.dylib in Frameworks */, + 8BFC81A311FF9C2F002CB4DC /* CPlusTest.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -203,6 +233,9 @@ 08FB7794FE84155DC02AAC07 /* MinidumpWriter */ = { isa = PBXGroup; children = ( + 8BFC812011FF99D5002CB4DC /* Breakpad.xcconfig */, + 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */, + 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */, F9721FA80E8B0E4800D7E813 /* md5.c */, F9721F760E8B0DC700D7E813 /* bytereader.cc */, F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */, @@ -261,9 +294,12 @@ 9B37CEEA0AF98EB600FA4BD4 /* Frameworks */ = { isa = PBXGroup; children = ( + 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */, + 8BFC815411FF9B7F002CB4DC /* Carbon.framework */, F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */, F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */, 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */, + 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */, ); name = Frameworks; sourceTree = ""; @@ -414,7 +450,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "minidump_test" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* MinidumpWriter */; projectDirPath = ""; @@ -513,6 +549,7 @@ D2F6510E0BEF94EB00920385 /* macho_walker.cc in Sources */, D2F651110BEF951700920385 /* string_conversion.cc in Sources */, D2F651150BEF953000920385 /* convert_UTF.c in Sources */, + 8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -524,6 +561,7 @@ 9B7CA8550B1298A100CD3A1D /* minidump_file_writer.cc in Sources */, 9BC1D2940B336F2300F2A2B4 /* convert_UTF.c in Sources */, 9BC1D2950B336F2500F2A2B4 /* string_conversion.cc in Sources */, + 8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -543,6 +581,7 @@ D2F6511E0BEF973600920385 /* macho_id.cc in Sources */, D2F6511F0BEF973900920385 /* macho_utilities.cc in Sources */, D2F651210BEF975400920385 /* macho_walker.cc in Sources */, + 8BFC81AF11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -580,6 +619,7 @@ files = ( F9AE5B390DBFDBDB00505983 /* dynamic_images.cc in Sources */, F9AE5B3A0DBFDBDB00505983 /* DynamicImagesTests.cc in Sources */, + 8BFC81AD11FF9C8A002CB4DC /* breakpad_nlist_64.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -589,154 +629,78 @@ 1DEB923208733DC60010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_CW_ASM_SYNTAX = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_PASCAL_STRINGS = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_THREADSAFE_STATICS = NO; - INSTALL_PATH = "$(HOME)/bin"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", + ); PRODUCT_NAME = generator_test; USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Debug; }; 1DEB923308733DC60010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(DEVELOPER_FRAMEWORKS_DIR)\"", ); - GCC_CW_ASM_SYNTAX = NO; - GCC_ENABLE_PASCAL_STRINGS = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_THREADSAFE_STATICS = NO; - INSTALL_PATH = "$(HOME)/bin"; PRODUCT_NAME = generator_test; USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Release; }; 1DEB923608733DC60010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - OTHER_LDFLAGS = "-lcrypto"; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Debug; }; 1DEB923708733DC60010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - OTHER_LDFLAGS = "-lcrypto"; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Release; }; 9B7CA8510B12984300CD3A1D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = "$(HOME)/bin"; - PREBINDING = NO; PRODUCT_NAME = unit_test; USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Debug; }; 9B7CA8520B12984300CD3A1D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = "$(HOME)/bin"; - PREBINDING = NO; PRODUCT_NAME = unit_test; USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Release; }; 9BD82AA70B0026BF0055103E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH)"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - INSTALL_PATH = "$(HOME)/bin"; - OTHER_CFLAGS = "-Wall"; - PREBINDING = NO; PRODUCT_NAME = handler_test; USER_HEADER_SEARCH_PATHS = "../../.. $(inherited)"; - ZERO_LINK = NO; }; name = Debug; }; 9BD82AA80B0026BF0055103E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH)"; - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - INSTALL_PATH = "$(HOME)/bin"; - OTHER_CFLAGS = "-Wall"; - PREBINDING = NO; PRODUCT_NAME = handler_test; USER_HEADER_SEARCH_PATHS = "../../.. $(inherited)"; - ZERO_LINK = NO; }; name = Release; }; F93A88770E8B4C700026AF89 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_CHAR_IS_UNSIGNED_CHAR = YES; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; INFOPLIST_FILE = "obj-cTestCases-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Cocoa, - "-framework", - SenTestingKit, - ); - PREBINDING = NO; PRODUCT_NAME = octestcases; USER_HEADER_SEARCH_PATHS = "../../../..//**"; WRAPPER_EXTENSION = octest; @@ -746,58 +710,20 @@ F93A88780E8B4C700026AF89 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_CHAR_IS_UNSIGNED_CHAR = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; INFOPLIST_FILE = "obj-cTestCases-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Cocoa, - "-framework", - SenTestingKit, - ); - PREBINDING = NO; PRODUCT_NAME = octestcases; USER_HEADER_SEARCH_PATHS = "../../../..//**"; WRAPPER_EXTENSION = octest; - ZERO_LINK = NO; }; name = Release; }; F9AE19C40DB04A9500C98454 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - "$(NATIVE_ARCH_64_BIT)", - ppc64, - ); - COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "minidump_tests64-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.5; - OTHER_LDFLAGS = ( - "-framework", - Carbon, - "-framework", - CPlusTest, - ); - PREBINDING = NO; PRODUCT_NAME = minidump_tests64; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; USER_HEADER_SEARCH_PATHS = "../../../**"; WRAPPER_EXTENSION = cptest; }; @@ -806,57 +732,19 @@ F9AE19C50DB04A9500C98454 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - "$(NATIVE_ARCH_64_BIT)", - ppc64, - ); - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "minidump_tests64-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.5; - OTHER_LDFLAGS = ( - "-framework", - Carbon, - "-framework", - CPlusTest, - ); - PREBINDING = NO; PRODUCT_NAME = minidump_tests64; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; USER_HEADER_SEARCH_PATHS = "../../../**"; WRAPPER_EXTENSION = cptest; - ZERO_LINK = NO; }; name = Release; }; F9AE5B350DBFDBA300505983 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH)"; - COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "minidump_tests32-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-framework", - Carbon, - "-framework", - CPlusTest, - "-lcrypto", - ); - PREBINDING = NO; PRODUCT_NAME = minidump_tests32; USER_HEADER_SEARCH_PATHS = "../../../**"; WRAPPER_EXTENSION = cptest; @@ -866,28 +754,11 @@ F9AE5B370DBFDBA300505983 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH)"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; INFOPLIST_FILE = "minidump_tests32-Info.plist"; - INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-lcrypto", - "-framework", - Carbon, - "-framework", - CPlusTest, - ); - PREBINDING = NO; PRODUCT_NAME = minidump_tests32; USER_HEADER_SEARCH_PATHS = "../../../**"; WRAPPER_EXTENSION = cptest; - ZERO_LINK = NO; }; name = Release; }; diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc index 10768541196..6142ad124a1 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc @@ -59,7 +59,7 @@ ProtectedMemoryAllocator::~ProtectedMemoryAllocator() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -char *ProtectedMemoryAllocator::Allocate(size_t bytes) { +char *ProtectedMemoryAllocator::Allocate(vm_size_t bytes) { if (valid_ && next_alloc_offset_ + bytes <= pool_size_) { char *p = (char*)base_address_ + next_alloc_offset_; next_alloc_offset_ += bytes; diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h index ed4f51d5cf8..7e188db268a 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h @@ -53,7 +53,7 @@ class ProtectedMemoryAllocator { // Fails by returning NULL is no more space is available. // Please note that the pointers returned from this method should not // be freed in any way (for example by calling free() on them ). - char * Allocate(size_t n); + char * Allocate(vm_size_t n); // Returns the base address of the allocation pool. char * GetBaseAddress() { return (char*)base_address_; } @@ -78,7 +78,7 @@ class ProtectedMemoryAllocator { private: vm_size_t pool_size_; vm_address_t base_address_; - int next_alloc_offset_; + vm_size_t next_alloc_offset_; bool valid_; }; diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h index ca5b30797e6..c0728ca8c11 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h @@ -35,6 +35,7 @@ #include #include "client/mac/Framework/Breakpad.h" +#import "GTMDefines.h" #define kClientIdPreferenceKey @"clientid" @@ -53,10 +54,10 @@ extern NSString *const kDefaultServerType; // work in the middle of a validation. @interface LengthLimitingTextField : NSTextField { @private - unsigned int maximumLength_; + NSUInteger maximumLength_; } -- (void) setMaximumLength:(unsigned int)maxLength; +- (void)setMaximumLength:(NSUInteger)maxLength; @end @interface Reporter : NSObject { diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m index 6aa8887d999..cdee262b14d 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m @@ -56,20 +56,20 @@ NSString *const kDefaultServerType = @"google"; @interface NSView (ResizabilityExtentions) // Shifts the view vertically by the given amount. -- (void)breakpad_shiftVertically:(float)offset; +- (void)breakpad_shiftVertically:(CGFloat)offset; // Shifts the view horizontally by the given amount. -- (void)breakpad_shiftHorizontally:(float)offset; +- (void)breakpad_shiftHorizontally:(CGFloat)offset; @end @implementation NSView (ResizabilityExtentions) -- (void)breakpad_shiftVertically:(float)offset { +- (void)breakpad_shiftVertically:(CGFloat)offset { NSPoint origin = [self frame].origin; origin.y += offset; [self setFrameOrigin:origin]; } -- (void)breakpad_shiftHorizontally:(float)offset { +- (void)breakpad_shiftHorizontally:(CGFloat)offset { NSPoint origin = [self frame].origin; origin.x += offset; [self setFrameOrigin:origin]; @@ -79,11 +79,11 @@ NSString *const kDefaultServerType = @"google"; @interface NSWindow (ResizabilityExtentions) // Adjusts the window height by heightDelta relative to its current height, // keeping all the content at the same size. -- (void)breakpad_adjustHeight:(float)heightDelta; +- (void)breakpad_adjustHeight:(CGFloat)heightDelta; @end @implementation NSWindow (ResizabilityExtentions) -- (void)breakpad_adjustHeight:(float)heightDelta { +- (void)breakpad_adjustHeight:(CGFloat)heightDelta { [[self contentView] setAutoresizesSubviews:NO]; NSRect windowFrame = [self frame]; @@ -101,16 +101,16 @@ NSString *const kDefaultServerType = @"google"; // Grows or shrinks the height of the field to the minimum required to show the // current text, preserving the existing width and origin. // Returns the change in height. -- (float)breakpad_adjustHeightToFit; +- (CGFloat)breakpad_adjustHeightToFit; // Grows or shrinks the width of the field to the minimum required to show the // current text, preserving the existing height and origin. // Returns the change in width. -- (float)breakpad_adjustWidthToFit; +- (CGFloat)breakpad_adjustWidthToFit; @end @implementation NSTextField (ResizabilityExtentions) -- (float)breakpad_adjustHeightToFit { +- (CGFloat)breakpad_adjustHeightToFit { NSRect oldFrame = [self frame]; // Starting with the 10.5 SDK, height won't grow, so make it huge to start. NSRect presizeFrame = oldFrame; @@ -125,7 +125,7 @@ NSString *const kDefaultServerType = @"google"; return newSize.height - NSHeight(oldFrame); } -- (float)breakpad_adjustWidthToFit { +- (CGFloat)breakpad_adjustWidthToFit { NSRect oldFrame = [self frame]; [self sizeToFit]; return NSWidth([self frame]) - NSWidth(oldFrame); @@ -136,11 +136,11 @@ NSString *const kDefaultServerType = @"google"; // Resizes to fit the label using IB-style size-to-fit metrics and enforcing a // minimum width of 70, while preserving the right edge location. // Returns the change in width. -- (float)breakpad_smartSizeToFit; +- (CGFloat)breakpad_smartSizeToFit; @end @implementation NSButton (ResizabilityExtentions) -- (float)breakpad_smartSizeToFit { +- (CGFloat)breakpad_smartSizeToFit { NSRect oldFrame = [self frame]; [self sizeToFit]; NSRect newFrame = [self frame]; @@ -218,7 +218,8 @@ NSString *const kDefaultServerType = @"google"; // Run an alert window with the given timeout. Returns // NSRunStoppedResponse if the timeout is exceeded. A timeout of 0 // queues the message immediately in the modal run loop. -- (int)runModalWindow:(NSWindow*)window withTimeout:(NSTimeInterval)timeout; +- (NSInteger)runModalWindow:(NSWindow*)window + withTimeout:(NSTimeInterval)timeout; // Returns a unique client id (user-specific), creating a persistent // one in the user defaults, if necessary. @@ -386,7 +387,7 @@ NSString *const kDefaultServerType = @"google"; } // Otherwise, if we have no client id, generate one! - srandom([[NSDate date] timeIntervalSince1970]); + srandom((int)[[NSDate date] timeIntervalSince1970]); long clientId1 = random(); long clientId2 = random(); long clientId3 = random(); @@ -403,8 +404,8 @@ NSString *const kDefaultServerType = @"google"; unsigned int logFileCounter = 0; NSString *logPath; - int logFileTailSize = [[parameters_ objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE] - intValue]; + size_t logFileTailSize = + [[parameters_ objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE] intValue]; NSMutableArray *logFilenames; // An array of NSString, one per log file logFilenames = [[NSMutableArray alloc] init]; @@ -544,7 +545,7 @@ NSString *const kDefaultServerType = @"google"; // Get the timeout value for the notification. NSTimeInterval timeout = [self messageTimeout]; - int buttonPressed = NSAlertAlternateReturn; + NSInteger buttonPressed = NSAlertAlternateReturn; // Determine whether we should create a text box for user feedback. if ([self shouldRequestComments]) { BOOL didLoadNib = [NSBundle loadNibNamed:@"Breakpad" owner:self]; @@ -592,7 +593,7 @@ NSString *const kDefaultServerType = @"google"; [commentMessage_ setStringValue:[NSString stringWithFormat:@"%@\n\n%@", [self explanatoryDialogText], NSLocalizedString(@"commentsMsg", @"")]]; - float commentHeightDelta = [commentMessage_ breakpad_adjustHeightToFit]; + CGFloat commentHeightDelta = [commentMessage_ breakpad_adjustHeightToFit]; [headerBox_ breakpad_shiftVertically:commentHeightDelta]; [alertWindow_ breakpad_adjustHeight:commentHeightDelta]; @@ -600,7 +601,7 @@ NSString *const kDefaultServerType = @"google"; // section depending on whether or not we are asking for email. if (includeEmail) { [emailMessage_ setStringValue:NSLocalizedString(@"emailMsg", @"")]; - float emailHeightDelta = [emailMessage_ breakpad_adjustHeightToFit]; + CGFloat emailHeightDelta = [emailMessage_ breakpad_adjustHeightToFit]; [preEmailBox_ breakpad_shiftVertically:emailHeightDelta]; [alertWindow_ breakpad_adjustHeight:emailHeightDelta]; } else { @@ -609,7 +610,7 @@ NSString *const kDefaultServerType = @"google"; // Localize the email label, and shift the associated text field. [emailLabel_ setStringValue:NSLocalizedString(@"emailLabel", @"")]; - float emailLabelWidthDelta = [emailLabel_ breakpad_adjustWidthToFit]; + CGFloat emailLabelWidthDelta = [emailLabel_ breakpad_adjustWidthToFit]; [emailEntryField_ breakpad_shiftHorizontally:emailLabelWidthDelta]; // Localize the placeholder text. @@ -620,12 +621,12 @@ NSString *const kDefaultServerType = @"google"; // Localize the privacy policy label, and keep it right-aligned to the arrow. [privacyLinkLabel_ setStringValue:NSLocalizedString(@"privacyLabel", @"")]; - float privacyLabelWidthDelta = [privacyLinkLabel_ breakpad_adjustWidthToFit]; + CGFloat privacyLabelWidthDelta = [privacyLinkLabel_ breakpad_adjustWidthToFit]; [privacyLinkLabel_ breakpad_shiftHorizontally:(-privacyLabelWidthDelta)]; // Localize the buttons, and keep the cancel button at the right distance. [sendButton_ setTitle:NSLocalizedString(@"sendReportButton", @"")]; - float sendButtonWidthDelta = [sendButton_ breakpad_smartSizeToFit]; + CGFloat sendButtonWidthDelta = [sendButton_ breakpad_smartSizeToFit]; [cancelButton_ breakpad_shiftHorizontally:(-sendButtonWidthDelta)]; [cancelButton_ setTitle:NSLocalizedString(@"cancelButton", @"")]; [cancelButton_ breakpad_smartSizeToFit]; @@ -633,12 +634,13 @@ NSString *const kDefaultServerType = @"google"; - (void)removeEmailPrompt { [emailSectionBox_ setHidden:YES]; - float emailSectionHeight = NSHeight([emailSectionBox_ frame]); + CGFloat emailSectionHeight = NSHeight([emailSectionBox_ frame]); [preEmailBox_ breakpad_shiftVertically:(-emailSectionHeight)]; [alertWindow_ breakpad_adjustHeight:(-emailSectionHeight)]; } -- (int)runModalWindow:(NSWindow*)window withTimeout:(NSTimeInterval)timeout { +- (NSInteger)runModalWindow:(NSWindow*)window + withTimeout:(NSTimeInterval)timeout { // Queue a |stopModal| message to be performed in |timeout| seconds. if (timeout > 0.001) { remainingDialogTime_ = timeout; @@ -653,7 +655,7 @@ NSString *const kDefaultServerType = @"google"; // Run the window modally and wait for either a |stopModal| message or a // button click. [NSApp activateIgnoringOtherApps:YES]; - int returnMethod = [NSApp runModalForWindow:window]; + NSInteger returnMethod = [NSApp runModalForWindow:window]; return returnMethod; } @@ -717,7 +719,7 @@ doCommandBySelector:(SEL)commandSelector { if (remainingDialogTime_ > 59) { // calculate minutes remaining for UI purposes - displayedTimeLeft = (remainingDialogTime_ / 60); + displayedTimeLeft = (int)(remainingDialogTime_ / 60); if (displayedTimeLeft == 1) { formatString = NSLocalizedString(@"countdownMsgMinuteSingular", @""); @@ -725,8 +727,8 @@ doCommandBySelector:(SEL)commandSelector { formatString = NSLocalizedString(@"countdownMsgMinutesPlural", @""); } } else { - displayedTimeLeft = remainingDialogTime_; - if (remainingDialogTime_ == 1) { + displayedTimeLeft = (int)remainingDialogTime_; + if (displayedTimeLeft == 1) { formatString = NSLocalizedString(@"countdownMsgSecondSingular", @""); } else { formatString = NSLocalizedString(@"countdownMsgSecondsPlural", @""); @@ -797,7 +799,8 @@ doCommandBySelector:(SEL)commandSelector { NSTimeInterval now = CFAbsoluteTimeGetCurrent(); NSTimeInterval spanSeconds = (now - lastTime); - [programDict setObject:[NSNumber numberWithFloat:now] forKey:kLastSubmission]; + [programDict setObject:[NSNumber numberWithDouble:now] + forKey:kLastSubmission]; [ud setObject:programDict forKey:program]; [ud synchronize]; @@ -1055,7 +1058,7 @@ doCommandBySelector:(SEL)commandSelector { //============================================================================= @implementation LengthLimitingTextField -- (void) setMaximumLength:(unsigned int)maxLength { +- (void)setMaximumLength:(NSUInteger)maxLength { maximumLength_ = maxLength; } @@ -1072,7 +1075,7 @@ shouldChangeTextInRange:(NSRange)affectedCharRange } // Figure out what the new string length would be, taking into // account user selections. - int newStringLength = + NSUInteger newStringLength = [[textView string] length] - affectedCharRange.length + [replacementString length]; if (newStringLength > maximumLength_) { @@ -1088,7 +1091,7 @@ shouldChangeTextInRange:(NSRange)affectedCharRange NSText* fieldEditor = [self currentEditor]; if (fieldEditor != nil) { // Check for a single "Command" modifier - unsigned int modifiers = [event modifierFlags]; + NSUInteger modifiers = [event modifierFlags]; modifiers &= NSDeviceIndependentModifierFlagsMask; if (modifiers == NSCommandKeyMask) { // Now, check for Select All, Cut, Copy, or Paste key equivalents. diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..4cfd32c54b7f216718ef1a97d69bd92a2a92a143 GIT binary patch literal 156 zcmezOpFxSinZb?0iJ_Dsk0FI2har{0k0FsE7f35HC@|OpF-S!bP^_3C1IP;k$`ml< f14T-JtRkSSH3JtGQ(PD_fjSC+CMGgel4B+SuMryf literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..2b8bb969398e68e8cec2fb664b816d9c5761a3d4 GIT binary patch literal 2428 zcmc(h$!-%t5Qgi_Q;aNp$-xmEgOJ!FMS_483-05cc)Z9n8|zvtE&C;$GM$ZVm&KtZC`C+6U%uY+miRhKJzvTtB>pyNR0UmEDh@=@(KH6 zzEeH}BvUk|tk3M+o>;54_YTd}GUO+Ah1JxC!FCJjmwZ~*MPH|~GUplLC9$@>;@hK0 z@s(qvBU|U{Eau}mDy&+KWfR{tG$-i`ghr*qb}=fPJ*%sWjLCI-cFZih%+?W;r8qb_e& zh!RR5YCs>}on8)`)o-rcJ487JxvG5sCcga}oeebyzvk}PWM zs~6MI4Tm{=33{=no1TYgsG2Hm$$1awL?Qp`RLN|R)te?*!QN~apKPf6b?Q;Yz8r_n z@~ZWYavM{$m67Kn-8ehPq1K%*x25TKOC0NcuE%)mB9$^XM_{>RE!}l(VhP`jD97x^ zEGpg=jm!HKtkC#9yWWY4ud?s~&tg2QMRU35>SEu$svFgVve?=&ElqltD6png9%iN1 znozTyE%}eVc7x|QPv7ir0P$C!QPIxsE2RO z>El|T?EPN4nR_=ds2g+3U3vo+RkTwwEy(DCoATW5!qb7*CC>y@bejxV&pB;c6$(O1 zRy$Nlfs8m2(P7!- ohMZC|>K$|HJiW4KVbCO|9OPDti7{!vAp77px(XcPSgwD*yrIM+KmY&$ literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..73da36f48b35902943a91752a8f9d5df5f82fa90 GIT binary patch literal 2746 zcmeH}%We}v5JhXvSF|j$$-iP4#WBV5D+-jTK#HKc~g`S5t({r$IdMf?yi*{;B47K`J`29@s zLHk4f7FvBt7Sb5&e&0Iw!di{JLunRPNq%G>Wwo$@+ipqvjaJJJT|3yR>>!1;OI^YC z?5%#UZK*x9g6^iSeJz=}(3D!idipQ*2ASI0viW)giW6ZSN#>#du4|KzQWh7wZnW?L z7CaC1U#$Ghwf`71dka~JvQy96*f9>I`BU+cJMfZuayZoeRG5Puxn8gj+8HZju>zn1 zQ(t?;+RO%TBEm}Yyd?v8IF|-kK%4SNO=FJOyRbVwkxibK9wWFWdWsbahVQXf&!Zo$ z-oTVttDd906oz28k_j$dtz(LHfDco}`d(-wPj=_TSeA$vyeWqJc_XjnX0-Y*g_Rs- zc07;iKSTbNA>WnVx$~KR;hsK$DT(WQ_R3y*A8%$zUkst^;bSdZ4{Oj>rE6WV8crsb zWv=5HCho%G*txOeQx9Qp;r&O?PuxEFVFuxkNST^+4U^)XBw!v>>sHT^f%I>omHCHs zA$!%MSbxY8y_sV>mS&tdM{6xS4SYA|K6X3aK>WCZ*YX9<6xW4tlj}mWfEiEqqTWz@ zbPLfXEh+M;R6Yu27Rxi;$GMXyGmKf-FIl_Q z+c*QM|0hXju5c2R>zSXky3P8~^(G!6(N6qS;N)OpWjmjRk+>@DrZXc~;b86gO7}(ZV?I<`kSjgqvrRja9{VT=K>DP4&wdX%$>q??|VkFIM zkMo(6fy`IWSb@bo&k#tPy3EaU-x)lk`&AW6XYl>3oJu!V@&G}X9YNcAD#dN5}u$in*R~<(byyH|{=uE35 z#TnJC^q$_)Go`vDeglvTx;{=maHW|rShJlBZ}&+jGA)<#2#a$rp7OfQXZ-GZ+UtpX Yf^W>SO_4SwcZsuUXIq?2+09Y@1@J)L6aWAK literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..a82c013e059dbf7918192662fe2d4030ff6aee37 GIT binary patch literal 184 zcmbu2I|_g>5JX??DMGFxHY%3hVKD}T_`zu5<<&WWoyD;1o0;AF!PC%DbFvUfjPw|@ prpHl9US#E9B1(hYpnaDUlyah`UJ}d7mJ}a1TQxJAQpWZF!wVZxASeI; literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..c31d6f48bb2c7e913abc209842492eeb7d2364af GIT binary patch literal 2578 zcmds(%Wl(95Qb;XQ&Fbq zO-YNy3Pp~`?@>=&5k(oj7Yroavfa?sP5r zO#Czb=ej16%%yQIde_GGz(zgZD{1C7m;B7$$ZBp=w>^^db6q2Q>sE4WBo$sJx?j4N z9ov@-XfoLkZy>|tR5mk7F7$RKZTN6=t3)q^wXi+ef3^kDp)_ZbNmyPB1O7@~=vVHu z6>lzz9D%;FFHR3JlNqpNx`PeGp)KiLXhrz7mBkIBbEX{)0n2Y{{6jT+~{0;?UEvYo_9{DZqs{Hc2U2b`6n) zwX}PfdbS8LBe|`XN0PyBp?Re;!wnp@2PYQEa`>thO;^M4lP0dq?OoP~R>A_Cq_e>p zaH{8dZx^#!?pKL~iLF(tJBhXRb7g3gE}q*r#Thk>?xSj*CcB#b+ulHgPsKSNSbsMX9ZYp*L>l28{z8f^`mPoazOm8 zPWofzsl$KnF*Wv7=lIwz{I{nQves`Vyqu`fE#n(GYdtS`np5)Uc5qjahmRkVp0kr!Xoy%{^#4{ZcofVUp*W7iA<$0 nfX)|t@^??eIlC>UL$^+UFq!v{sk+v?UqpRBe-lyPPsH;J4xqw_ literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..4cfd32c54b7f216718ef1a97d69bd92a2a92a143 GIT binary patch literal 156 zcmezOpFxSinZb?0iJ_Dsk0FI2har{0k0FsE7f35HC@|OpF-S!bP^_3C1IP;k$`ml< f14T-JtRkSSH3JtGQ(PD_fjSC+CMGgel4B+SuMryf literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..c32f8ff7a6219853e541db1bf3df512b3f5e7786 GIT binary patch literal 2694 zcmd^>OKuZE5Qb~b4cLt=vWdVJEI~+whlE4|QLG$bVmr=A_Sj@5LC$G78q4?+!2eab zJ>$fAEZ8B-_H=hW|N5(X{`~IQu4UG@+Rm-8(#BS4eQGnUGdtF5yVkQO)@kj1lxA)d$&c-`tmZa!+Z{>2)wg5&_B6|FuFvF_ zmmPa2nMx8P{nmP}U3)6Y(w2J8++Jo=SuVAEt!UWgoOqEhC3B(wj=i}jx&wI_OQwkn zJC!Zm^R+y%9(fcK{exI8yI`1B+p<8eR0iNi26Jh#x72FsYp||m>D*4VQ(0HL$CA#p z6Ua~(biq66f&0=eL`;{$_`)sE{pnIsT}gi8=#|F#LVHyBm%f2*$g-CUv#3p+$BLMv z{-H_cckGqxwQCFhQ||r|{`fpE#=&8zCk+(DwTPG_UxqD9;b!3mZQ7H49nSAmn zn24~7$x`W)BB7U}@9CSNB$xn9P5KkB13!nYg-1NH=Q?Y86n>^|1rMf6Oe=bpK5R=T z-sf&N@T(k!#twPokJ)k}{YopQV6q0H^(tFrD*2CjwOm&eEFzbLQB3pAsvjytA{lAs z&-8qAqHnUKvB?dC-i36CBqmF>?%Adq4|&*TCpw>a8$0{*0u~ePrn$cN$a?*>*Xzib zcfrJgX6QDnN1B9V`H7n#>K9ex?qnU4l)JD{=F63B;)OTdQAhfxN165Sg%W(AqD}0u zvOULx--qiC;0-46Zm`hZh@Gj{O})|LE~tg!Om@pvH lQvYqs@4$V)6XLrszj$9tlDEA*CcCz`hq7z?yX`G<`wKXU=jQ+b literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..4cfd32c54b7f216718ef1a97d69bd92a2a92a143 GIT binary patch literal 156 zcmezOpFxSinZb?0iJ_Dsk0FI2har{0k0FsE7f35HC@|OpF-S!bP^_3C1IP;k$`ml< f14T-JtRkSSH3JtGQ(PD_fjSC+CMGgel4B+SuMryf literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..a4b7fd3acd5f3b8030d47d81fa4c3db03a1d987c GIT binary patch literal 2590 zcmd^>%Wl(95Qb;XQ$!V2r3xCs5`@HERJ2gF@BmKYB$g68%B5BNgggpsc5HzEo5`u& z;Iyj54q0}N$8+ZL|1)#)`&ZZYtz&1lw7C^l+Q=4qA6ljNj(ycz?yFCdETu8j-M7rw zmGnE35B1D+_obO>$5`uq>)Hd`X~^DcXJ!-WkL-i2W;Sr!JJNokd&iD!PtuvL$=b`6 ze({p)`>wszb0JB`zU%JGPhl%b@Lkwc`{vR<*HyT5s(qy*&Fw(epWhPCvGhmMNs$~X zg7CHQ{Zscr6cdkyJU|Rdd&ERpdhGn7H&m@F9z;3OwI?~ufLzUYlL@|p zPvG6tIv4ucHOlZ#?r%I=>fzsT4}uB1zGDjqH}N4is(_qo*0)FVzcByA9(w<5V;^Lv z;(H`E={azXy4ba+zBi#6U0q2#_1D5SQT!qsQ6IT1(x;iUsp)}#Y1UqUElJE)ir`%A zh4-Sh(y)`OSLl$!wM$8&XDZ3bh8eL?h4*!#yYTPSEVBZQRL4|s<$CmCniNsf_}|R# zy|m}5aC#)XMwCl=BL;epJn?j;3t4WD-7A`p^gfd`CP?6t>X~Y00?^$tL!#H1xsd^L zFXm3qdeTYAvPNU%y_b-lN&0i0Ygi73Q=V;Xo+!r5Q5(zN#BrK8rX#V|>=WhC_0f&# z1t&!dl6P5dvs10@5NXZHkv#VFK54}Du7UBhYwyAMxkq@ZGv@Dohe9k)Jn916(T?h2 zBC@_|C2E9-Vu}y!RI$J*yuJ3h%5*Lp(cvW~G8Mx7+??g9^5D93{3ly%z0&tmULv}* zk12PiIHX6jr1S+!@>^mCt#YA-3D EKfkuZ{r~^~ literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..4cfd32c54b7f216718ef1a97d69bd92a2a92a143 GIT binary patch literal 156 zcmezOpFxSinZb?0iJ_Dsk0FI2har{0k0FsE7f35HC@|OpF-S!bP^_3C1IP;k$`ml< f14T-JtRkSSH3JtGQ(PD_fjSC+CMGgel4B+SuMryf literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..1f1a4fee5cd6f98defce31446463266b67048904 GIT binary patch literal 1792 zcmb_dJ!n&56ulJ`b#ZqwM7wloj&3S~#12CK+Jq2mhxnSlByG}{*d{HhRIG@!R-r^h z(M=q5a1aL(CkH_{aj=s^=^$3Ox>=0perbM9e-L@RyzhJOe&?Qh?oTSeJ<=mCiAX^v zWKpWErhtZ#_tMu=Rq>LgljG+%t@r_LU zn7*U_T9w(_-~UsmRf*$r%;c=9Mhr_3EsVjN%;0S)4hxI-W~TOD^I-u;m#o<`K1ULa{W|6uzr$Ma;x_X1 zy24z2XU%;ev)ANj4?GGhw-7ao(zaIB)!u21zMnj_hHZ9Oj_daRc}etj*5v-muizo; zK&93njVN|PXg#SM8fX3VJ?I4i@9xG`_ihIL*}aT0oD+FZSyNI709s%T3u&uNA|jI~)e zjXZ1SY>76CGj3E@2DQ2eMI{Q5BpN&2`btn&ymoS^GLyM>qpNm1&2H0B5QS&WQ&o2E(ZC~>IDOY;W6`DSvlTat9c z4q0~Y&-|P@cV=#W{T$e#Wp-|jEp1|zjcuj*wbhzucA;76qt9AtByp{GWVw%P$!A)> z);HHXl4LH88;uWbV9%`ASv!_yZZpY`?UStLR=Dk+q~Gc7*|FxCEZ6#7xTVzwQ)UPD zUV9Tqhu?3mdnc)p{58Hl*4oPT7y9;P@$DWAr;;5@CV2-_quI*t-AbwXT=UYS%=Hbt zyD)~_cVWDBjY^}ic%|PTj+y97+3CyfaAO(H7J6VD{}JOH}h?09Jxb| zvitYxj-2J-nL69XBN;;{sI(tBv^~damkSis!b(q^aiLlCoY)1=%4?gxbn6*TE>Q8< zj;=%&AW7C!om4`y6Z5twrHt)Kj(VCX&mYHfq%|U-w$}26pCn6IvQ&*z8@{Ahs_k5n1*V~wfOE06qPB|bi@ zGwI^Dlt!&_bg;JP4L7{fH>i6s6B(zyR77zjfH3vamXD`wV~4&$^zby>*q~#yR!)SE z6J$4a;-S6#!+P>dznTaw(cIfMt+NLbna|>Gm`RhK+{OWh$h^Y7YCUz|58|QG1LhXb zr6iV;hb1x%+ufd>Fmf+e&i2fS197&!uC-1{w`2h!o5Z6%`y=smCu+pKU;rkJt$l)rPaz|8=^+?@M7a)!IS l?Thc!eUK$+?~8BVk)*2r#ext_7SMAo(| z{Z6z;L@T@3ey$UL8tc21)s=SqUPqQ*p74Du`BXB&Yv0z|K{t3L1~SSO;ZpmNEe;|h zmJm~BQ$5HH6iMbHL1&}bGHG&FSx4vB4l(ju=mBFg^awX~$;Q_p#8gUpF4>VXjbxGN zBE=0B;223GllOpEsNhCB6Z;~GnLHwg#gYCwNo0rIL6C2sCy@j+0-Dq^R}60zv#;^L z)f2Bj^n$y`3LMBO(Lb34&!_zU|FwK>PaXgNw4QKkAOr(*+xEg)2x$7AgiG*%J}PY= z#hV>p=hwdzSK)>It}%R=k@ z8A=>=ZJC)^JVff89qKeww28F+MDsR?smA+*q^R;tyJ4PQH_*M@d8VSUfY{e|Oz%#1 zDj^hZAu!Lkh}6h4!zdnb(QXeaVfDWgl>s$Ki)o{p+h z=t+hCSezMZJ=f_&tDpdqSnY^2m1L+EH)P<~N|{!|qLAHuI}OMJi(pjhX6A+ksb;0y z4nHuT>eSyuaGM?iUHWSyt-4dOc+OjY%K*9#{?;fQ`g`2hsoZXz2c{YG=~Qm>og}h< Pms``@x!jum9?R`F*M+v{ literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..585f6221dc91a2e19ef05347bbee12e0626e227e GIT binary patch literal 184 zcmbu2Jq|!X5QRUj#2sX>AsR#}uCPHtuws$8Jf2>scyA{2e&)I{^u{1IB!nNG1-)F0l9u!ThX?+YAMgMG literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..b7dfeecebe02c401d3d6e6f124fe16974d81fd60 GIT binary patch literal 2632 zcmds(%Wo1<6vhu*6aI$@v71IAy408$ABl_B5Sw;?p_K9(NM~px3;%TW`<=ruLxVKB zG=zEFdmi8U&g0InpFKOZ%r307JDXT;V=MH2V@thfcB!|KKYi6oDTy2XhnD<#Dfvw6 zH@YVMhmuUvxYhHi_3W8-8f%}VnQSikv3-%%WY=!HBk6bgcdRdccCoV1%89+#6$F`0 z{hI5#(*DHStzvJ+qCT*qd8dw%#7`elDA1$y9zXWUo*}BlijmM8yhtCwjwf zjf|Dtb?`gTQ!O=d97G0NUG2kR={WB^ia;Cjgf3QAvX75;3u{Yzp|zR&9t%aLwIp7N zIAl|6?$$sZOrde@ve;Va3C-9K&NA5pS?<`#KW6ZiJy*RS%ObTkP%g-PQl6+Va{t;jn;9E=1uVod zxi0K6UwyB&Li!6y;oK+H zJi5B#u_GLG5!fE{cct~z$|Uj9nMNJKVHe^g6b%6FFmUk9-Zum_zh$Tj^ICu7|x?+bDICtjff3!ng%p4`vR%wFnVvFW5f-6N6J-FU!?K4tE z4?CBN>8yeO)?-?U&7OV_{_A>|Q~6B(u5eRFJu$&aUhxbsaEjHgDyozW+2SOxs&B2R zORu2^Jw;a%4Hn_I&>WbHS0+|7(in>;-=uuPdH?_b literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..4cfd32c54b7f216718ef1a97d69bd92a2a92a143 GIT binary patch literal 156 zcmezOpFxSinZb?0iJ_Dsk0FI2har{0k0FsE7f35HC@|OpF-S!bP^_3C1IP;k$`ml< f14T-JtRkSSH3JtGQ(PD_fjSC+CMGgel4B+SuMryf literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..f7d1251668bb433b683da995409eacb54d5fc0be GIT binary patch literal 2588 zcmd^>+iKfD5QgWvPqCO9+CXjE%Y;A=2?Uxnp(YO?pPk4DEZHUR+q^N5={!uedP1_N_dfub@*mM7WWjsO2-_^rM4-4SC|XK{a)gMODvP;5hWHtn6ac2f0E z=w4Nva<5(}?0IA_EaIp$3ob|HtB+>Bz9OHTTo!&u84fibx-IlXT4S;xyin`WLYF;N zx~A0HThg-+Ug(AqOw>Q2g4DZWp#IqGy4bI>q*>MT-KJBqwi~Rc$ka#A{k=~5Pu9g$ z-PK21SOa_G`&hFJ89rC2E rS%Ib6uKyMMiMJbTpKn(lLH|xvTl;*QCYtK(-iyMY=HuyEQDP&@P+*beKOYHnPJP8 zw4gB!S=hZhcjnBQGjqB9-LwNstZjwOY-pMFE$8{lCOjv0&Qs6tzOqtaamCfK)bA(Q zC#+xbopN=sOxZEu{=k~{%<7f3PwY(X8vDL|!E0(=_g%;O9ar7#{aG%2-JSQVOT{T@f~^flbKH})KDzJQ0Q;t8#^= zk}jpn=maS>#lBTjud24{kJMF|yV{}?!spU`j-3Vd?!&6rj#7(tVyX+o_9o`f_R1Bl z{?#TYIK`=dbY}6Z(j1IkFD%S>{rLD7h|T#gLW%R;f%`5>H;fGijj9t zwYHI!BIY33b4@Eh&CbzXJ~1Kh*W%Qf6T1T#i@7$d%&2lgX(lP3@Gj;TD~88+Q*X`I zF0Y#NnkcGr)oaX8;avMVCZ^``bp_RZ_7Cq6OyP9MBvs}MduZno@0a)zt1;70J@28{ zLGwIEPiq`Ps>+=48xyRs5Aa{`(TTL4=4b2;i#a(RRi@+mRFHPX_4Ok@Ue~7h)wxyf z(IjfGFgzUh8}?G^x(@eQDDx8|=j3r*!94Ihrgq5r*|Z=2X`syspFSvhXeYY2Np4kc zm8lq%*9O`th+m>Eb*5e_;BJE7Y}G-^MIOazZqkWPfylT#7x#G=O4iI;up{QR)LEU< v^0O;O8xQ)Q5hr|A*?$*hTP`Q=TUt=xZ_A}ihB~pOuYb#>8e>;3+oSve2xX}~ literal 0 HcmV?d00001 diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m index a324f147e99..87c43024bc1 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m @@ -31,6 +31,7 @@ #import "Controller.h" #import "TestClass.h" +#import "GTMDefines.h" #include #include @@ -51,7 +52,7 @@ } - (IBAction)forkTestOptions:(id)sender { - int tag = [[sender selectedCell] tag]; + NSInteger tag = [[sender selectedCell] tag]; NSLog(@"sender tag: %d", tag); if (tag <= 2) { bpForkOption = tag; @@ -75,7 +76,7 @@ NSString *resourcePath = [[NSBundle bundleForClass: [self class]] resourcePath]; - NSString *execProgname; + NSString *execProgname = nil; if (progCrashPoint == DURINGLAUNCH) { execProgname = [resourcePath stringByAppendingString:@"/crashduringload"]; } else if (progCrashPoint == AFTERLAUNCH) { @@ -129,11 +130,11 @@ } - (IBAction)crash:(id)sender { - int tag = [sender tag]; + NSInteger tag = [sender tag]; if (tag == 1) { [NSObject cancelPreviousPerformRequestsWithTarget:self]; - [self performSelector:@selector(causeCrash) withObject:nil afterDelay:10]; + [self performSelector:@selector(causeCrash) withObject:nil afterDelay:10.0]; [sender setState:NSOnState]; return; } diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib index ebc623c42a0..840c0db33bb 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib @@ -3,10 +3,22 @@ 1050 10F569 - 762 + 788 1038.29 461.00 + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + YES YES @@ -15,17 +27,6 @@ YES - - YES - - - - YES - - - YES - - YES @@ -52,7 +53,7 @@ {1.79769e+308, 1.79769e+308} {213, 107} - + 256 YES @@ -61,6 +62,7 @@ 301 {{14, 140}, {292, 32}} + YES 67239424 @@ -88,6 +90,7 @@ 301 {{14, 76}, {292, 32}} + 2 YES @@ -113,6 +116,7 @@ 301 {{14, 108}, {292, 32}} + 1 YES @@ -138,6 +142,7 @@ 268 {{14, 44}, {292, 32}} + YES 67239424 @@ -158,6 +163,7 @@ 268 {{14, 12}, {292, 32}} + YES 67239424 @@ -175,6 +181,8 @@ {320, 188} + + {{0, 0}, {1440, 878}} {213, 129} @@ -782,7 +790,7 @@ {1.79769e+308, 1.79769e+308} - + 256 YES @@ -804,7 +812,7 @@ 5 1211912703 - 128 + 0 NSRadioButton @@ -821,7 +829,7 @@ 6 1211912703 - 128 + 0 549453824 {18, 18} @@ -930,7 +938,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 7 1211912703 - 128 + 0 549453824 {18, 18} @@ -1040,7 +1048,7 @@ AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAA 5 1211912703 - 128 + 0 @@ -1080,7 +1088,7 @@ AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAA 1211912703 - 128 + 0 @@ -1095,7 +1103,7 @@ AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAA 1 1211912703 - 128 + 0 549453824 {18, 18} @@ -1201,7 +1209,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 2 1211912703 - 128 + 0 549453824 {18, 18} @@ -1309,7 +1317,7 @@ AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAARadio 1211912703 - 128 + 0 549453824 {18, 18} @@ -1378,7 +1386,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 3 1211912703 - 128 + 0 @@ -1393,7 +1401,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 4 1211912703 - 128 + 0 549453824 {18, 18} @@ -1502,7 +1510,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA Radio 1211912703 - 128 + 0 549453824 {18, 18} @@ -1579,6 +1587,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {787, 260} + {{0, 0}, {1440, 878}} {1.79769e+308, 1.79769e+308} @@ -2614,194 +2623,382 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES YES + -3.IBPluginDependency -3.ImportedFromIB2 + 103.IBPluginDependency 103.ImportedFromIB2 + 106.IBPluginDependency 106.ImportedFromIB2 + 111.IBPluginDependency 111.ImportedFromIB2 + 112.IBPluginDependency 112.ImportedFromIB2 + 124.IBPluginDependency 124.ImportedFromIB2 + 125.IBPluginDependency 125.ImportedFromIB2 + 126.IBPluginDependency 126.ImportedFromIB2 + 129.IBPluginDependency 129.ImportedFromIB2 + 130.IBPluginDependency 130.ImportedFromIB2 + 131.IBPluginDependency 131.ImportedFromIB2 + 134.IBPluginDependency 134.ImportedFromIB2 + 136.IBPluginDependency 136.ImportedFromIB2 + 143.IBPluginDependency 143.ImportedFromIB2 + 144.IBPluginDependency 144.ImportedFromIB2 + 145.IBPluginDependency 145.ImportedFromIB2 + 149.IBPluginDependency 149.ImportedFromIB2 + 150.IBPluginDependency 150.ImportedFromIB2 + 154.IBPluginDependency 154.ImportedFromIB2 + 155.IBPluginDependency 155.ImportedFromIB2 + 156.IBPluginDependency 156.ImportedFromIB2 + 157.IBPluginDependency 157.ImportedFromIB2 + 158.IBPluginDependency 158.ImportedFromIB2 + 159.IBPluginDependency 159.ImportedFromIB2 + 160.IBPluginDependency 160.ImportedFromIB2 + 161.IBPluginDependency 161.ImportedFromIB2 + 162.IBPluginDependency 162.ImportedFromIB2 + 163.IBPluginDependency 163.ImportedFromIB2 + 164.IBPluginDependency 164.ImportedFromIB2 + 167.IBPluginDependency 167.ImportedFromIB2 + 168.IBPluginDependency 168.ImportedFromIB2 + 169.IBPluginDependency 169.ImportedFromIB2 + 171.IBPluginDependency 171.ImportedFromIB2 + 172.IBPluginDependency 172.ImportedFromIB2 + 173.IBPluginDependency 173.ImportedFromIB2 + 174.IBPluginDependency 174.ImportedFromIB2 + 184.IBPluginDependency 184.ImportedFromIB2 + 185.IBPluginDependency 185.ImportedFromIB2 + 187.IBPluginDependency 187.ImportedFromIB2 + 189.IBPluginDependency 189.ImportedFromIB2 + 19.IBPluginDependency 19.ImportedFromIB2 + 191.IBPluginDependency 191.ImportedFromIB2 + 196.IBPluginDependency 196.ImportedFromIB2 + 197.IBPluginDependency 197.ImportedFromIB2 + 2.IBPluginDependency 2.ImportedFromIB2 + 204.IBPluginDependency 204.ImportedFromIB2 + 206.IBPluginDependency 206.ImportedFromIB2 207.ImportedFromIB2 21.IBEditorWindowLastContentRect + 21.IBPluginDependency 21.IBWindowTemplateEditedContentRect 21.ImportedFromIB2 21.windowTemplate.hasMinSize 21.windowTemplate.minSize + 210.IBPluginDependency 210.ImportedFromIB2 + 212.IBPluginDependency 212.ImportedFromIB2 + 218.IBPluginDependency 218.ImportedFromIB2 220.IBEditorWindowLastContentRect + 220.IBPluginDependency 220.IBWindowTemplateEditedContentRect 220.ImportedFromIB2 + 221.IBPluginDependency 221.ImportedFromIB2 + 226.IBPluginDependency 226.ImportedFromIB2 + 227.IBPluginDependency 227.ImportedFromIB2 + 228.IBPluginDependency 228.ImportedFromIB2 + 23.IBPluginDependency 23.ImportedFromIB2 + 232.IBPluginDependency 232.ImportedFromIB2 + 233.IBPluginDependency 233.ImportedFromIB2 + 234.IBPluginDependency 234.ImportedFromIB2 + 236.IBPluginDependency 236.ImportedFromIB2 + 237.IBPluginDependency 237.ImportedFromIB2 + 238.IBPluginDependency 238.ImportedFromIB2 + 239.IBPluginDependency 239.ImportedFromIB2 + 24.IBPluginDependency 24.ImportedFromIB2 + 248.IBPluginDependency 248.ImportedFromIB2 + 272.IBPluginDependency 272.ImportedFromIB2 29.IBEditorWindowLastContentRect + 29.IBPluginDependency 29.ImportedFromIB2 + 325.IBPluginDependency 325.ImportedFromIB2 + 329.IBPluginDependency + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBPluginDependency + 333.IBPluginDependency + 334.IBPluginDependency + 335.IBPluginDependency + 336.IBPluginDependency + 337.IBPluginDependency + 5.IBPluginDependency 5.ImportedFromIB2 + 56.IBPluginDependency 56.ImportedFromIB2 + 57.IBPluginDependency 57.ImportedFromIB2 + 58.IBPluginDependency 58.ImportedFromIB2 + 72.IBPluginDependency 72.ImportedFromIB2 + 73.IBPluginDependency 73.ImportedFromIB2 + 74.IBPluginDependency 74.ImportedFromIB2 + 75.IBPluginDependency 75.ImportedFromIB2 + 77.IBPluginDependency 77.ImportedFromIB2 + 78.IBPluginDependency 78.ImportedFromIB2 + 79.IBPluginDependency 79.ImportedFromIB2 + 80.IBPluginDependency 80.ImportedFromIB2 + 81.IBPluginDependency 81.ImportedFromIB2 + 82.IBPluginDependency 82.ImportedFromIB2 + 83.IBPluginDependency 83.ImportedFromIB2 + 92.IBPluginDependency 92.ImportedFromIB2 YES + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{42, 911}, {320, 188}} - {{42, 911}, {320, 188}} + {{510, 1250}, {320, 188}} + com.apple.InterfaceBuilder.CocoaPlugin + {{510, 1250}, {320, 188}} {213, 107} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - {{21, 862}, {787, 260}} - {{21, 862}, {787, 260}} + {{-55, 1287}, {787, 260}} + com.apple.InterfaceBuilder.CocoaPlugin + {{-55, 1287}, {787, 260}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{0, 1114}, {362, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -2848,6 +3045,40 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA id + + YES + + YES + crash: + forkTestGo: + forkTestOptions: + generateReportWithoutCrash: + showForkTestWindow: + + + YES + + crash: + id + + + forkTestGo: + id + + + forkTestOptions: + id + + + generateReportWithoutCrash: + id + + + showForkTestWindow: + id + + + YES @@ -2861,6 +3092,33 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NSWindow + + YES + + YES + forkTestOptions_ + window_ + + + YES + + forkTestOptions_ + NSWindow + + + window_ + NSWindow + + + + + IBProjectSource + testapp/Controller.h + + + + Controller + NSObject IBUserSource @@ -2875,6 +3133,586 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + + clearRecentDocuments: + id + + + newDocument: + id + + + openDocument: + id + + + saveAllDocuments: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + 0 IBCocoaFramework @@ -2882,12 +3720,16 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin.macosx + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES - ../GoogleBreakpadTest.xcodeproj + ../../Breakpad.xcodeproj 3 YES diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm index cade633e94e..6e6a8833d5b 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm @@ -78,7 +78,7 @@ void InternalTestClass::InternalFunction(AStruct &s) { float InternalTestClass::kStaticFloatValue = 42; static float PlainOldFunction() { - return 3.14145; + return 3.14145f; } @implementation TestClass diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/SimpleStringDictionaryTest.h b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/SimpleStringDictionaryTest.h index 1f48517f674..53f6ae42247 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/SimpleStringDictionaryTest.h +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/SimpleStringDictionaryTest.h @@ -27,7 +27,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#import +#import "GTMSenTestCase.h" #import "SimpleStringDictionary.h" @interface SimpleStringDictionaryTest : GTMTestCase { diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/auto_tempdir.h b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/auto_tempdir.h new file mode 100644 index 00000000000..b6473a5cdd4 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/auto_tempdir.h @@ -0,0 +1,72 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Utility class for creating a temporary directory for unit tests +// that is deleted in the destructor. +#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_AUTO_TEMPDIR +#define GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_AUTO_TEMPDIR + +#include +#include + +#include + +namespace google_breakpad { + +class AutoTempDir { + public: + AutoTempDir() { + char tempDir[16] = "/tmp/XXXXXXXXXX"; + mkdtemp(tempDir); + path = tempDir; + } + + ~AutoTempDir() { + // First remove any files in the dir + DIR* dir = opendir(path.c_str()); + if (!dir) + return; + + dirent* entry; + while ((entry = readdir(dir)) != NULL) { + if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) + continue; + std::string entryPath = path + "/" + entry->d_name; + unlink(entryPath.c_str()); + } + closedir(dir); + rmdir(path.c_str()); + } + + std::string path; +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_AUTO_TEMPDIR diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc new file mode 100644 index 00000000000..1ea5bf16f29 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc @@ -0,0 +1,223 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// crash_generation_server_test.cc +// Unit tests for CrashGenerationServer + +#include +#include +#include +#include +#include + +#include + +#include "breakpad_googletest_includes.h" +#include "client/mac/crash_generation/client_info.h" +#include "client/mac/crash_generation/crash_generation_client.h" +#include "client/mac/crash_generation/crash_generation_server.h" +#include "client/mac/handler/exception_handler.h" +#include "client/mac/tests/auto_tempdir.h" + +namespace { +using std::string; +using google_breakpad::AutoTempDir; +using google_breakpad::ClientInfo; +using google_breakpad::CrashGenerationClient; +using google_breakpad::CrashGenerationServer; +using google_breakpad::ExceptionHandler; +using testing::Test; + +class CrashGenerationServerTest : public Test { +public: + // The port name to receive messages on + char mach_port_name[128]; + // Filename of the last dump that was generated + string last_dump_name; + // PID of the child process + pid_t child_pid; + // A temp dir + AutoTempDir temp_dir; + // Counter just to ensure that we don't hit the same port again + static int i; + + void SetUp() { + sprintf(mach_port_name, + "com.google.breakpad.ServerTest.%d.%d", getpid(), + CrashGenerationServerTest::i++); + child_pid = (pid_t)-1; + } +}; +int CrashGenerationServerTest::i = 0; + +// Test that starting and stopping a server works +TEST_F(CrashGenerationServerTest, testStartStopServer) { + CrashGenerationServer server(mach_port_name, + NULL, // dump callback + NULL, // dump context + NULL, // exit callback + NULL, // exit context + false, // generate dumps + ""); // dump path + ASSERT_TRUE(server.Start()); + ASSERT_TRUE(server.Stop()); +} + +// Test that requesting a dump via CrashGenerationClient works +// Test without actually dumping +TEST_F(CrashGenerationServerTest, testRequestDumpNoDump) { + CrashGenerationServer server(mach_port_name, + NULL, // dump callback + NULL, // dump context + NULL, // exit callback + NULL, // exit context + false, // don't generate dumps + temp_dir.path); // dump path + ASSERT_TRUE(server.Start()); + + pid_t pid = fork(); + ASSERT_NE(-1, pid); + if (pid == 0) { + CrashGenerationClient client(mach_port_name); + bool result = client.RequestDump(); + exit(result ? 0 : 1); + } + + int ret; + ASSERT_EQ(pid, waitpid(pid, &ret, 0)); + EXPECT_TRUE(WIFEXITED(ret)); + EXPECT_EQ(0, WEXITSTATUS(ret)); + EXPECT_TRUE(server.Stop()); + // check that no minidump was written + string pattern = temp_dir.path + "/*"; + glob_t dirContents; + ret = glob(pattern.c_str(), GLOB_NOSORT, NULL, &dirContents); + EXPECT_EQ(GLOB_NOMATCH, ret); + if (ret != GLOB_NOMATCH) + globfree(&dirContents); +} + +void dumpCallback(void *context, const ClientInfo &client_info, + const std::string &file_path) { + if (context) { + CrashGenerationServerTest* self = + reinterpret_cast(context); + if (!file_path.empty()) + self->last_dump_name = file_path; + self->child_pid = client_info.pid(); + } +} + +void *RequestDump(void *context) { + CrashGenerationClient client((const char*)context); + bool result = client.RequestDump(); + return (void*)(result ? 0 : 1); +} + +// Test that actually writing a minidump works +TEST_F(CrashGenerationServerTest, testRequestDump) { + CrashGenerationServer server(mach_port_name, + dumpCallback, // dump callback + this, // dump context + NULL, // exit callback + NULL, // exit context + true, // generate dumps + temp_dir.path); // dump path + ASSERT_TRUE(server.Start()); + + pid_t pid = fork(); + ASSERT_NE(-1, pid); + if (pid == 0) { + // Have to spawn off a separate thread to request the dump, + // because MinidumpGenerator assumes the handler thread is not + // the only thread + pthread_t thread; + if (pthread_create(&thread, NULL, RequestDump, (void*)mach_port_name) != 0) + exit(1); + void* result; + pthread_join(thread, &result); + exit(reinterpret_cast(result)); + } + + int ret; + ASSERT_EQ(pid, waitpid(pid, &ret, 0)); + EXPECT_TRUE(WIFEXITED(ret)); + EXPECT_EQ(0, WEXITSTATUS(ret)); + EXPECT_TRUE(server.Stop()); + // check that minidump was written + ASSERT_FALSE(last_dump_name.empty()); + struct stat st; + EXPECT_EQ(0, stat(last_dump_name.c_str(), &st)); + EXPECT_LT(0, st.st_size); + // check client's PID + ASSERT_EQ(pid, child_pid); +} + +static void Crasher() { + int *a = (int*)0x42; + + fprintf(stdout, "Going to crash...\n"); + fprintf(stdout, "A = %d", *a); +} + +// Test that crashing a child process with an OOP ExceptionHandler installed +// results in a minidump being written by the CrashGenerationServer in +// the parent. +TEST_F(CrashGenerationServerTest, testChildProcessCrash) { + CrashGenerationServer server(mach_port_name, + dumpCallback, // dump callback + this, // dump context + NULL, // exit callback + NULL, // exit context + true, // generate dumps + temp_dir.path); // dump path + ASSERT_TRUE(server.Start()); + + pid_t pid = fork(); + ASSERT_NE(-1, pid); + if (pid == 0) { + // Instantiate an OOP exception handler. + ExceptionHandler eh("", NULL, NULL, NULL, true, mach_port_name); + Crasher(); + // not reached + exit(0); + } + + int ret; + ASSERT_EQ(pid, waitpid(pid, &ret, 0)); + EXPECT_FALSE(WIFEXITED(ret)); + EXPECT_TRUE(server.Stop()); + // check that minidump was written + ASSERT_FALSE(last_dump_name.empty()); + struct stat st; + EXPECT_EQ(0, stat(last_dump_name.c_str(), &st)); + EXPECT_LT(0, st.st_size); +} + +} // namespace diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc new file mode 100644 index 00000000000..09237313e43 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc @@ -0,0 +1,198 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// exception_handler_test.cc: Unit tests for google_breakpad::ExceptionHandler + +#include +#include + +#include "breakpad_googletest_includes.h" +#include "client/mac/handler/exception_handler.h" +#include "client/mac/tests/auto_tempdir.h" +#include "common/mac/MachIPC.h" + +namespace { +using std::string; +using google_breakpad::AutoTempDir; +using google_breakpad::ExceptionHandler; +using google_breakpad::MachPortSender; +using google_breakpad::MachReceiveMessage; +using google_breakpad::MachSendMessage; +using google_breakpad::ReceivePort; +using testing::Test; + +class ExceptionHandlerTest : public Test { + public: + AutoTempDir tempDir; + string lastDumpName; +}; + +static void Crasher() { + int *a = (int*)0x42; + + fprintf(stdout, "Going to crash...\n"); + fprintf(stdout, "A = %d", *a); +} + +static void SoonToCrash() { + Crasher(); +} + +static bool MDCallback(const char *dump_dir, const char *file_name, + void *context, bool success) { + string path(dump_dir); + path.append("/"); + path.append(file_name); + path.append(".dmp"); + + int fd = *reinterpret_cast(context); + (void)write(fd, path.c_str(), path.length() + 1); + close(fd); + exit(0); + // not reached + return true; +} + +TEST_F(ExceptionHandlerTest, InProcess) { + AutoTempDir tempDir; + // Give the child process a pipe to report back on. + int fds[2]; + ASSERT_EQ(0, pipe(fds)); + // Fork off a child process so it can crash. + pid_t pid = fork(); + if (pid == 0) { + // In the child process. + close(fds[0]); + ExceptionHandler eh(tempDir.path, NULL, MDCallback, &fds[1], true, NULL); + // crash + SoonToCrash(); + // not reached + exit(1); + } + // In the parent process. + ASSERT_NE(-1, pid); + // Wait for the background process to return the minidump file. + close(fds[1]); + char minidump_file[PATH_MAX]; + ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file)); + ASSERT_NE(0, nbytes); + // Ensure that minidump file exists and is > 0 bytes. + struct stat st; + ASSERT_EQ(0, stat(minidump_file, &st)); + ASSERT_LT(0, st.st_size); + + // Child process should have exited with a zero status. + int ret; + ASSERT_EQ(pid, waitpid(pid, &ret, 0)); + EXPECT_NE(0, WIFEXITED(ret)); + EXPECT_EQ(0, WEXITSTATUS(ret)); +} + +static bool ChildMDCallback(const char *dump_dir, const char *file_name, + void *context, bool success) { + ExceptionHandlerTest *self = reinterpret_cast(context); + if (dump_dir && file_name) { + self->lastDumpName = dump_dir; + self->lastDumpName += "/"; + self->lastDumpName += file_name; + self->lastDumpName += ".dmp"; + } + return true; +} + +TEST_F(ExceptionHandlerTest, DumpChildProcess) { + const int kTimeoutMs = 2000; + // Create a mach port to receive the child task on. + char machPortName[128]; + sprintf(machPortName, "ExceptionHandlerTest.%d", getpid()); + ReceivePort parent_recv_port(machPortName); + + // Give the child process a pipe to block on. + int fds[2]; + ASSERT_EQ(0, pipe(fds)); + + // Fork off a child process to dump. + pid_t pid = fork(); + if (pid == 0) { + // In the child process + close(fds[0]); + + // Send parent process the task and thread ports. + MachSendMessage child_message(0); + child_message.AddDescriptor(mach_task_self()); + child_message.AddDescriptor(mach_thread_self()); + + MachPortSender child_sender(machPortName); + if (child_sender.SendMessage(child_message, kTimeoutMs) != KERN_SUCCESS) + exit(1); + + // Wait for the parent process. + uint8_t data; + read(fds[1], &data, 1); + exit(0); + } + // In the parent process. + ASSERT_NE(-1, pid); + close(fds[1]); + + // Read the child's task and thread ports. + MachReceiveMessage child_message; + ASSERT_EQ(KERN_SUCCESS, + parent_recv_port.WaitForMessage(&child_message, kTimeoutMs)); + mach_port_t child_task = child_message.GetTranslatedPort(0); + mach_port_t child_thread = child_message.GetTranslatedPort(1); + ASSERT_NE(MACH_PORT_NULL, child_task); + ASSERT_NE(MACH_PORT_NULL, child_thread); + + // Write a minidump of the child process. + bool result = ExceptionHandler::WriteMinidumpForChild(child_task, + child_thread, + tempDir.path, + ChildMDCallback, + this); + ASSERT_EQ(true, result); + + // Ensure that minidump file exists and is > 0 bytes. + ASSERT_FALSE(lastDumpName.empty()); + struct stat st; + ASSERT_EQ(0, stat(lastDumpName.c_str(), &st)); + ASSERT_LT(0, st.st_size); + + // Unblock child process + uint8_t data = 1; + (void)write(fds[0], &data, 1); + + // Child process should have exited with a zero status. + int ret; + ASSERT_EQ(pid, waitpid(pid, &ret, 0)); + EXPECT_NE(0, WIFEXITED(ret)); + EXPECT_EQ(0, WEXITSTATUS(ret)); +} + +} diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h index 7c556a27c95..0e12e00b69e 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h +++ b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h @@ -61,27 +61,30 @@ inline bool TypedMDRVA::AllocateArray(size_t count) { } template -inline bool TypedMDRVA::AllocateObjectAndArray(unsigned int count, - size_t size) { - assert(count && size); +inline bool TypedMDRVA::AllocateObjectAndArray(size_t count, + size_t length) { + assert(count && length); allocation_state_ = SINGLE_OBJECT_WITH_ARRAY; - return UntypedMDRVA::Allocate(minidump_size::size() + count * size); + return UntypedMDRVA::Allocate(minidump_size::size() + count * length); } template inline bool TypedMDRVA::CopyIndex(unsigned int index, MDType *item) { assert(allocation_state_ == ARRAY); - return writer_->Copy(position_ + index * minidump_size::size(), item, - minidump_size::size()); + return writer_->Copy( + static_cast(position_ + index * minidump_size::size()), + item, minidump_size::size()); } template inline bool TypedMDRVA::CopyIndexAfterObject(unsigned int index, const void *src, - size_t size) { + size_t length) { assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY); - return writer_->Copy(position_ + minidump_size::size() + index * size, - src, size); + return writer_->Copy( + static_cast(position_ + minidump_size::size() + + index * length), + src, length); } template diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc index 1be3f504664..213e2be06b8 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc @@ -92,22 +92,22 @@ bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str, } else { u_int16_t out[2]; int out_idx = 0; - + // Copy the string character by character while (length && result) { UTF32ToUTF16Char(*str, out); if (!out[0]) return false; - + // Process one character at a time --length; ++str; - + // Append the one or two UTF-16 characters. The first one will be non- // zero, but the second one may be zero, depending on the conversion from // UTF-32. int out_count = out[1] ? 2 : 1; - int out_size = sizeof(u_int16_t) * out_count; + size_t out_size = sizeof(u_int16_t) * out_count; result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); out_idx += out_count; } @@ -127,14 +127,14 @@ bool MinidumpFileWriter::CopyStringToMDString(const char *str, int conversion_count = UTF8ToUTF16Char(str, length, out); if (!conversion_count) return false; - + // Move the pointer along based on the nubmer of converted characters length -= conversion_count; str += conversion_count; - + // Append the one or two UTF-16 characters int out_count = out[1] ? 2 : 1; - int out_size = sizeof(u_int16_t) * out_count; + size_t out_size = sizeof(u_int16_t) * out_count; result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); out_idx += out_count; } @@ -161,7 +161,8 @@ bool MinidumpFileWriter::WriteStringCore(const CharType *str, return false; // Set length excluding the NULL and copy the string - mdstring.get()->length = mdstring_length * sizeof(u_int16_t); + mdstring.get()->length = + static_cast(mdstring_length * sizeof(u_int16_t)); bool result = CopyStringToMDString(str, mdstring_length, &mdstring); // NULL terminate @@ -235,7 +236,7 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) { assert(file_ != -1); // Ensure that the data will fit in the allocated space - if (size + position > size_) + if (static_cast(size + position) > size_) return false; // Seek and write the data @@ -260,11 +261,11 @@ bool UntypedMDRVA::Allocate(size_t size) { return position_ != MinidumpFileWriter::kInvalidMDRVA; } -bool UntypedMDRVA::Copy(MDRVA position, const void *src, size_t size) { +bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) { assert(src); assert(size); - assert(position + size <= position_ + size_); - return writer_->Copy(position, src, size); + assert(pos + size <= position_ + size_); + return writer_->Copy(pos, src, size); } } // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h index f569a553597..cded35854ac 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h +++ b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h @@ -151,7 +151,7 @@ class UntypedMDRVA { // Return size and position inline MDLocationDescriptor location() const { - MDLocationDescriptor location = { size_, position_ }; + MDLocationDescriptor location = { static_cast(size_), position_ }; return location; } @@ -218,7 +218,7 @@ class TypedMDRVA : public UntypedMDRVA { // Allocate an array of |count| elements of |size| after object of MDType // Must not call more than once. // Return true on success, or false on failure - bool AllocateObjectAndArray(unsigned int count, size_t size); + bool AllocateObjectAndArray(size_t count, size_t size); // Copy |item| to |index| // Must have been allocated using AllocateArray(). diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc index a83307d9edb..08522fb214e 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc @@ -144,22 +144,23 @@ static bool CompareFile(const char *path) { 0x0000000a, 0x000a1c09, 0x0000000b, 0x00000000, #endif }; - unsigned int expected_byte_count = sizeof(expected); + size_t expected_byte_count = sizeof(expected); int fd = open(path, O_RDONLY, 0600); void *buffer = malloc(expected_byte_count); ASSERT_NE(fd, -1); ASSERT_TRUE(buffer); - ASSERT_EQ(read(fd, buffer, expected_byte_count), expected_byte_count); + ASSERT_EQ(read(fd, buffer, expected_byte_count), + static_cast(expected_byte_count)); char *b1, *b2; - b1 = (char*)buffer; - b2 = (char*)expected; + b1 = reinterpret_cast(buffer); + b2 = reinterpret_cast(expected); while (*b1 == *b2) { b1++; b2++; } - printf("%d\n",b1 - (char*)buffer); + printf("%p\n", reinterpret_cast(b1 - (char*)buffer)); ASSERT_EQ(memcmp(buffer, expected, expected_byte_count), 0); return true; diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc index a9b0020f598..8721b7a5823 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc @@ -125,7 +125,7 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer, // address. size_t skew = section_base_ & (AddressSize() - 1); // Now find the offset from that aligned address to buffer. - size_t offset = skew + (buffer - buffer_base_); + off_t offset = skew + (buffer - buffer_base_); // Round up to the next boundary. size_t aligned = (offset + AddressSize() - 1) & -AddressSize(); // Convert back to a pointer. diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h index aaa97c4f75d..f01f319d928 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h @@ -301,7 +301,7 @@ class ByteReader { // Base addresses for Linux C++ exception handling data's encoded pointers. bool have_section_base_, have_text_base_, have_data_base_; bool have_function_base_; - uint64 section_base_, text_base_, data_base_, function_base_; + size_t section_base_, text_base_, data_base_, function_base_; const char *buffer_base_; }; diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc index a2915bad0fe..23f7ffa842f 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc @@ -34,6 +34,7 @@ #include "common/dwarf/dwarf2reader.h" #include +#include #include #include @@ -90,7 +91,7 @@ void CompilationUnit::ReadAbbrevs() { while (1) { CompilationUnit::Abbrev abbrev; size_t len; - const uint32 number = reader_->ReadUnsignedLEB128(abbrevptr, &len); + const uint64 number = reader_->ReadUnsignedLEB128(abbrevptr, &len); if (number == 0) break; @@ -98,7 +99,7 @@ void CompilationUnit::ReadAbbrevs() { abbrevptr += len; assert(abbrevptr < abbrev_start + abbrev_length); - const uint32 tag = reader_->ReadUnsignedLEB128(abbrevptr, &len); + const uint64 tag = reader_->ReadUnsignedLEB128(abbrevptr, &len); abbrevptr += len; abbrev.tag = static_cast(tag); @@ -109,11 +110,11 @@ void CompilationUnit::ReadAbbrevs() { assert(abbrevptr < abbrev_start + abbrev_length); while (1) { - const uint32 nametemp = reader_->ReadUnsignedLEB128(abbrevptr, &len); + const uint64 nametemp = reader_->ReadUnsignedLEB128(abbrevptr, &len); abbrevptr += len; assert(abbrevptr < abbrev_start + abbrev_length); - const uint32 formtemp = reader_->ReadUnsignedLEB128(abbrevptr, &len); + const uint64 formtemp = reader_->ReadUnsignedLEB128(abbrevptr, &len); abbrevptr += len; if (nametemp == 0 && formtemp == 0) break; @@ -515,7 +516,7 @@ void CompilationUnit::ProcessDIEs() { continue; } - const Abbrev& abbrev = abbrevs_->at(abbrev_num); + const Abbrev& abbrev = abbrevs_->at(static_cast(abbrev_num)); const enum DwarfTag tag = abbrev.tag; if (!handler_->StartDIE(absolute_offset, tag, abbrev.attributes)) { dieptr = SkipDIE(dieptr, abbrev); @@ -618,8 +619,8 @@ void LineInfo::ReadHeader() { uint64 filelength = reader_->ReadUnsignedLEB128(lineptr, &len); lineptr += len; - handler_->DefineFile(filename, fileindex, dirindex, mod_time, - filelength); + handler_->DefineFile(filename, fileindex, static_cast(dirindex), + mod_time, filelength); fileindex++; } } @@ -649,7 +650,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, opcode -= header.opcode_base; const int64 advance_address = (opcode / header.line_range) * header.min_insn_length; - const int64 advance_line = (opcode % header.line_range) + const int32 advance_line = (opcode % header.line_range) + header.line_base; // Check if the lsm passes "pc". If so, mark it as passed. @@ -689,7 +690,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, case DW_LNS_advance_line: { const int64 advance_line = reader->ReadSignedLEB128(start, &templen); oplen += templen; - lsm->line_num += advance_line; + lsm->line_num += static_cast(advance_line); // With gcc 4.2.1, we can get the line_no here for the first time // since DW_LNS_advance_line is called after DW_LNE_set_address is @@ -703,13 +704,13 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, case DW_LNS_set_file: { const uint64 fileno = reader->ReadUnsignedLEB128(start, &templen); oplen += templen; - lsm->file_num = fileno; + lsm->file_num = static_cast(fileno); } break; case DW_LNS_set_column: { const uint64 colno = reader->ReadUnsignedLEB128(start, &templen); oplen += templen; - lsm->column_num = colno; + lsm->column_num = static_cast(colno); } break; case DW_LNS_negate_stmt: { @@ -748,7 +749,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, } break; case DW_LNS_extended_op: { - const size_t extended_op_len = reader->ReadUnsignedLEB128(start, + const uint64 extended_op_len = reader->ReadUnsignedLEB128(start, &templen); start += templen; oplen += templen + extended_op_len; @@ -790,8 +791,8 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, oplen += templen; if (handler) { - handler->DefineFile(filename, -1, dirindex, mod_time, - filelength); + handler->DefineFile(filename, -1, static_cast(dirindex), + mod_time, filelength); } } break; @@ -803,7 +804,6 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader, // Ignore unknown opcode silently if (header.std_opcode_lengths) { for (int i = 0; i < (*header.std_opcode_lengths)[opcode]; i++) { - size_t templen; reader->ReadUnsignedLEB128(start, &templen); start += templen; oplen += templen; @@ -1940,7 +1940,7 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { // If we have a 'z' augmentation string, find the augmentation data and // use the augmentation string to parse it. if (cie->has_z_augmentation) { - size_t data_size = reader_->ReadUnsignedLEB128(cursor, &len); + uint64_t data_size = reader_->ReadUnsignedLEB128(cursor, &len); if (size_t(cie->end - cursor) < len + data_size) return ReportIncomplete(cie); cursor += len; @@ -2060,7 +2060,7 @@ bool CallFrameInfo::ReadFDEFields(FDE *fde) { // If the CIE has a 'z' augmentation string, then augmentation data // appears here. if (fde->cie->has_z_augmentation) { - size_t data_size = reader_->ReadUnsignedLEB128(cursor, &size); + uint64_t data_size = reader_->ReadUnsignedLEB128(cursor, &size); if (size_t(fde->end - cursor) < size + data_size) return ReportIncomplete(fde); cursor += size; diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h index a7a13afba16..5a255238f11 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h @@ -242,7 +242,7 @@ class CompilationUnit { // The abbreviation tells how to read a DWARF2/3 DIE, and consist of a // tag and a list of attributes, as well as the data form of each attribute. struct Abbrev { - uint32 number; + uint64 number; enum DwarfTag tag; bool has_children; AttributeList attributes; diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h index 6f9fb72b85b..0ff72abcfc2 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h @@ -48,7 +48,7 @@ struct LineStateMachine { uint32 file_num; uint64 address; - uint64 line_num; + uint32 line_num; uint32 column_num; bool is_stmt; // stmt means statement. bool basic_block; diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc index 611cecd5c33..ed0b406dd60 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc @@ -117,7 +117,7 @@ bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length, // address on entry to the function. So establish an initial .ra // rule citing the return address register. if (return_address_ < register_names_.size()) - entry_->initial_rules[".ra"] = register_names_[return_address_]; + entry_->initial_rules[ra_name_] = register_names_[return_address_]; return true; } @@ -126,11 +126,11 @@ string DwarfCFIToModule::RegisterName(int i) { assert(entry_); if (i < 0) { assert(i == kCFARegister); - return ".cfa"; + return cfa_name_; } unsigned reg = i; if (reg == return_address_) - return ".ra"; + return ra_name_; if (0 <= reg && reg < register_names_.size()) return register_names_[reg]; @@ -144,12 +144,21 @@ string DwarfCFIToModule::RegisterName(int i) { void DwarfCFIToModule::Record(Module::Address address, int reg, const string &rule) { assert(entry_); + + // Place the name in our global set of strings, and then use the string + // from the set. Even though the assignment looks like a copy, all the + // major std::string implementations use reference counting internally, + // so the effect is to have all our data structures share copies of rules + // whenever possible. Since register names are drawn from a + // vector, register names are already shared. + string shared_rule = *common_strings_.insert(rule).first; + // Is this one of this entry's initial rules? if (address == entry_->address) - entry_->initial_rules[RegisterName(reg)] = rule; + entry_->initial_rules[RegisterName(reg)] = shared_rule; // File it under the appropriate address. else - entry_->rule_changes[address][RegisterName(reg)] = rule; + entry_->rule_changes[address][RegisterName(reg)] = shared_rule; } bool DwarfCFIToModule::UndefinedRule(uint64 address, int reg) { diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h index dc11ec53fce..d29a796c04f 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h @@ -40,7 +40,9 @@ #define COMMON_LINUX_DWARF_CFI_TO_MODULE_H #include +#include +#include #include #include @@ -51,6 +53,7 @@ namespace google_breakpad { using dwarf2reader::CallFrameInfo; using google_breakpad::Module; +using std::set; using std::string; using std::vector; @@ -124,7 +127,8 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { DwarfCFIToModule(Module *module, const vector ®ister_names, Reporter *reporter) : module_(module), register_names_(register_names), reporter_(reporter), - entry_(NULL), return_address_(-1) { } + entry_(NULL), return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") { + } virtual ~DwarfCFIToModule() { delete entry_; } virtual bool Entry(size_t offset, uint64 address, uint64 length, @@ -168,6 +172,23 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { // The return address column for that entry. unsigned return_address_; + + // The names of the return address and canonical frame address. Putting + // these here instead of using string literals allows us to share their + // texts in reference-counted std::string implementations (all the + // popular ones). Many, many rules cite these strings. + string cfa_name_, ra_name_; + + // A set of strings used by this CFI. Before storing a string in one of + // our data structures, insert it into this set, and then use the string + // from the set. + // + // Because std::string uses reference counting internally, simply using + // strings from this set, even if passed by value, assigned, or held + // directly in structures and containers (map, for example), + // causes those strings to share a single instance of each distinct piece + // of text. + set common_strings_; }; } // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc index 85d1d8c485d..9b5382839bc 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc @@ -36,12 +36,16 @@ #include #include +#include +#include #include "common/dwarf_line_to_module.h" namespace google_breakpad { using std::map; +using std::pair; +using std::set; using std::vector; // Data provided by a DWARF specification DIE. @@ -83,6 +87,17 @@ typedef map AbstractOriginByOffset; // Data global to the DWARF-bearing file that is private to the // DWARF-to-Module process. struct DwarfCUToModule::FilePrivate { + // A set of strings used in this CU. Before storing a string in one of + // our data structures, insert it into this set, and then use the string + // from the set. + // + // Because std::string uses reference counting internally, simply using + // strings from this set, even if passed by value, assigned, or held + // directly in structures and containers (map, for example), + // causes those strings to share a single instance of each distinct piece + // of text. + set common_strings; + // A map from offsets of DIEs within the .debug_info section to // Specifications describing those DIEs. Specification references can // cross compilation unit boundaries. @@ -256,7 +271,17 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString( enum DwarfForm form, const string &data) { switch (attr) { - case dwarf2reader::DW_AT_name: name_attribute_ = data; break; + case dwarf2reader::DW_AT_name: { + // Place the name in our global set of strings, and then use the + // string from the set. Even though the assignment looks like a copy, + // all the major std::string implementations use reference counting + // internally, so the effect is to have all our data structures share + // copies of strings whenever possible. + pair::iterator, bool> result = + cu_context_->file_context->file_private->common_strings.insert(data); + name_attribute_ = *result.first; + break; + } default: break; } } diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc index d8a78942f55..65e577c81f3 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc @@ -46,7 +46,10 @@ #include #include +#include #include +#include +#include #include "common/dwarf/bytereader-inl.h" #include "common/dwarf/dwarf2diehandler.h" @@ -67,6 +70,64 @@ using google_breakpad::DwarfLineToModule; using google_breakpad::Module; using google_breakpad::StabsToModule; +// +// FDWrapper +// +// Wrapper class to make sure opened file is closed. +// +class FDWrapper { + public: + explicit FDWrapper(int fd) : + fd_(fd) {} + ~FDWrapper() { + if (fd_ != -1) + close(fd_); + } + int get() { + return fd_; + } + int release() { + int fd = fd_; + fd_ = -1; + return fd; + } + private: + int fd_; +}; + +// +// MmapWrapper +// +// Wrapper class to make sure mapped regions are unmapped. +// +class MmapWrapper { + public: + MmapWrapper() : is_set_(false) {} + ~MmapWrapper() { + assert(is_set_); + if (base_ != NULL) { + assert(size_ > 0); + munmap(base_, size_); + } + } + void set(void *mapped_address, size_t mapped_size) { + is_set_ = true; + base_ = mapped_address; + size_ = mapped_size; + } + void release() { + assert(is_set_); + base_ = NULL; + size_ = 0; + } + + private: + bool is_set_; + void *base_; + size_t size_; +}; + + // Fix offset into virtual address by adding the mapped base into offsets. // Make life easier when want to find something by offset. static void FixAddress(void *obj_base) { @@ -111,15 +172,22 @@ static const ElfW(Shdr) *FindSectionByName(const char *name, // Find the end of the section name section, to make sure that // comparisons don't run off the end of the section. - const char *names_end = + const char *names_end = reinterpret_cast(section_names->sh_offset + section_names->sh_size); for (int i = 0; i < nsection; ++i) { const char *section_name = reinterpret_cast(section_names->sh_offset + sections[i].sh_name); if (names_end - section_name >= name_len + 1 && - strcmp(name, section_name) == 0) + strcmp(name, section_name) == 0) { + if (sections[i].sh_type == SHT_NOBITS) { + fprintf(stderr, + "Section %s found, but ignored because type=SHT_NOBITS.\n", + name); + return NULL; + } return sections + i; + } } return NULL; } @@ -127,18 +195,8 @@ static const ElfW(Shdr) *FindSectionByName(const char *name, static bool LoadStabs(const ElfW(Ehdr) *elf_header, const ElfW(Shdr) *stab_section, const ElfW(Shdr) *stabstr_section, + const bool big_endian, Module *module) { - // Figure out what endianness this file is. - bool big_endian; - if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) - big_endian = false; - else if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) - big_endian = true; - else { - fprintf(stderr, "bad data encoding in ELF header: %d\n", - elf_header->e_ident[EI_DATA]); - return false; - } // A callback object to handle data from the STABS reader. StabsToModule handler(module); // Find the addresses of the STABS data, and create a STABS reader object. @@ -163,7 +221,7 @@ static bool LoadStabs(const ElfW(Ehdr) *elf_header, class DumperLineToModule: public DwarfCUToModule::LineToModuleFunctor { public: // Create a line-to-module converter using BYTE_READER. - DumperLineToModule(dwarf2reader::ByteReader *byte_reader) + explicit DumperLineToModule(dwarf2reader::ByteReader *byte_reader) : byte_reader_(byte_reader) { } void operator()(const char *program, uint64 length, Module *module, vector *lines) { @@ -177,18 +235,10 @@ class DumperLineToModule: public DwarfCUToModule::LineToModuleFunctor { static bool LoadDwarf(const string &dwarf_filename, const ElfW(Ehdr) *elf_header, + const bool big_endian, Module *module) { - // Figure out what endianness this file is. - dwarf2reader::Endianness endianness; - if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) - endianness = dwarf2reader::ENDIANNESS_LITTLE; - else if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) - endianness = dwarf2reader::ENDIANNESS_BIG; - else { - fprintf(stderr, "%s: bad data encoding in ELF header: %d\n", - dwarf_filename.c_str(), elf_header->e_ident[EI_DATA]); - return false; - } + const dwarf2reader::Endianness endianness = big_endian ? + dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE; dwarf2reader::ByteReader byte_reader(endianness); // Construct a context for this file. @@ -260,9 +310,10 @@ static bool LoadDwarfCFI(const string &dwarf_filename, const ElfW(Ehdr) *elf_header, const char *section_name, const ElfW(Shdr) *section, - bool eh_frame, + const bool eh_frame, const ElfW(Shdr) *got_section, const ElfW(Shdr) *text_section, + const bool big_endian, Module *module) { // Find the appropriate set of register names for this file's // architecture. @@ -274,17 +325,8 @@ static bool LoadDwarfCFI(const string &dwarf_filename, return false; } - // Figure out what endianness this file is. - dwarf2reader::Endianness endianness; - if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) - endianness = dwarf2reader::ENDIANNESS_LITTLE; - else if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) - endianness = dwarf2reader::ENDIANNESS_BIG; - else { - fprintf(stderr, "%s: bad data encoding in ELF header: %d\n", - dwarf_filename.c_str(), elf_header->e_ident[EI_DATA]); - return false; - } + const dwarf2reader::Endianness endianness = big_endian ? + dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE; // Find the call frame information and its size. const char *cfi = reinterpret_cast(section->sh_offset); @@ -313,7 +355,7 @@ static bool LoadDwarfCFI(const string &dwarf_filename, byte_reader.SetDataBase(got_section->sh_addr); if (text_section) byte_reader.SetTextBase(text_section->sh_addr); - + dwarf2reader::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename, section_name); dwarf2reader::CallFrameInfo parser(cfi, cfi_size, @@ -323,7 +365,159 @@ static bool LoadDwarfCFI(const string &dwarf_filename, return true; } -static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, +bool LoadELF(const std::string &obj_file, MmapWrapper* map_wrapper, + ElfW(Ehdr) **elf_header) { + int obj_fd = open(obj_file.c_str(), O_RDONLY); + if (obj_fd < 0) { + fprintf(stderr, "Failed to open ELF file '%s': %s\n", + obj_file.c_str(), strerror(errno)); + return false; + } + FDWrapper obj_fd_wrapper(obj_fd); + struct stat st; + if (fstat(obj_fd, &st) != 0 && st.st_size <= 0) { + fprintf(stderr, "Unable to fstat ELF file '%s': %s\n", + obj_file.c_str(), strerror(errno)); + return false; + } + void *obj_base = mmap(NULL, st.st_size, + PROT_READ | PROT_WRITE, MAP_PRIVATE, obj_fd, 0); + if (obj_base == MAP_FAILED) { + fprintf(stderr, "Failed to mmap ELF file '%s': %s\n", + obj_file.c_str(), strerror(errno)); + return false; + } + map_wrapper->set(obj_base, st.st_size); + *elf_header = reinterpret_cast(obj_base); + if (!IsValidElf(*elf_header)) { + fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); + return false; + } + return true; +} + +// Get the endianness of ELF_HEADER. If it's invalid, return false. +bool ElfEndianness(const ElfW(Ehdr) *elf_header, bool *big_endian) { + if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) { + *big_endian = false; + return true; + } + if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) { + *big_endian = true; + return true; + } + + fprintf(stderr, "bad data encoding in ELF header: %d\n", + elf_header->e_ident[EI_DATA]); + return false; +} + +// Read the .gnu_debuglink and get the debug file name. If anything goes +// wrong, return an empty string. +static std::string ReadDebugLink(const ElfW(Shdr) *debuglink_section, + const std::string &obj_file, + const std::string &debug_dir) { + char *debuglink = reinterpret_cast(debuglink_section->sh_offset); + size_t debuglink_len = strlen(debuglink) + 5; // '\0' + CRC32. + debuglink_len = 4 * ((debuglink_len + 3) / 4); // Round to nearest 4 bytes. + + // Sanity check. + if (debuglink_len != debuglink_section->sh_size) { + fprintf(stderr, "Mismatched .gnu_debuglink string / section size: " + "%zx %zx\n", debuglink_len, debuglink_section->sh_size); + return ""; + } + + std::string debuglink_path = debug_dir + "/" + debuglink; + int debuglink_fd = open(debuglink_path.c_str(), O_RDONLY); + if (debuglink_fd < 0) { + fprintf(stderr, "Failed to open debug ELF file '%s' for '%s': %s\n", + debuglink_path.c_str(), obj_file.c_str(), strerror(errno)); + return ""; + } + FDWrapper debuglink_fd_wrapper(debuglink_fd); + // TODO(thestig) check the CRC-32 at the end of the .gnu_debuglink + // section. + + return debuglink_path; +} + +// +// LoadSymbolsInfo +// +// Holds the state between the two calls to LoadSymbols() in case we have to +// follow the .gnu_debuglink section and load debug information from a +// different file. +// +class LoadSymbolsInfo { + public: + explicit LoadSymbolsInfo(const std::string &dbg_dir) : + debug_dir_(dbg_dir), + has_loading_addr_(false) {} + + // Keeps track of which sections have been loaded so we don't accidentally + // load it twice from two different files. + void LoadedSection(const std::string §ion) { + if (loaded_sections_.count(section) == 0) { + loaded_sections_.insert(section); + } else { + fprintf(stderr, "Section %s has already been loaded.\n", + section.c_str()); + } + } + + // We expect the ELF file and linked debug file to have the same prefered + // loading address. + void set_loading_addr(ElfW(Addr) addr, const std::string &filename) { + if (!has_loading_addr_) { + loading_addr_ = addr; + loaded_file_ = filename; + return; + } + + if (addr != loading_addr_) { + fprintf(stderr, + "ELF file '%s' and debug ELF file '%s' " + "have different load addresses.\n", + loaded_file_.c_str(), filename.c_str()); + assert(false); + } + } + + // Setters and getters + const std::string &debug_dir() const { + return debug_dir_; + } + + std::string debuglink_file() const { + return debuglink_file_; + } + void set_debuglink_file(std::string file) { + debuglink_file_ = file; + } + + private: + const std::string &debug_dir_; // Directory with the debug ELF file. + + std::string debuglink_file_; // Full path to the debug ELF file. + + bool has_loading_addr_; // Indicate if LOADING_ADDR_ is valid. + + ElfW(Addr) loading_addr_; // Saves the prefered loading address from the + // first call to LoadSymbols(). + + std::string loaded_file_; // Name of the file loaded from the first call to + // LoadSymbols(). + + std::set loaded_sections_; // Tracks the Loaded ELF sections + // between calls to LoadSymbols(). +}; + +static bool LoadSymbols(const std::string &obj_file, + const bool big_endian, + ElfW(Ehdr) *elf_header, + const bool read_gnu_debug_link, + LoadSymbolsInfo *info, Module *module) { // Translate all offsets in section headers into address. FixAddress(elf_header); @@ -331,6 +525,7 @@ static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, reinterpret_cast(elf_header->e_phoff), elf_header->e_phnum); module->SetLoadAddress(loading_addr); + info->set_loading_addr(loading_addr, obj_file); const ElfW(Shdr) *sections = reinterpret_cast(elf_header->e_shoff); @@ -345,9 +540,12 @@ static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, const ElfW(Shdr) *stabstr_section = stab_section->sh_link + sections; if (stabstr_section) { found_debug_info_section = true; - if (!LoadStabs(elf_header, stab_section, stabstr_section, module)) + info->LoadedSection(".stab"); + if (!LoadStabs(elf_header, stab_section, stabstr_section, big_endian, + module)) { fprintf(stderr, "%s: \".stab\" section found, but failed to load STABS" " debugging information\n", obj_file.c_str()); + } } } @@ -357,7 +555,8 @@ static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, elf_header->e_shnum); if (dwarf_section) { found_debug_info_section = true; - if (!LoadDwarf(obj_file, elf_header, module)) + info->LoadedSection(".debug_info"); + if (!LoadDwarf(obj_file, elf_header, big_endian, module)) fprintf(stderr, "%s: \".debug_info\" section found, but failed to load " "DWARF debugging information\n", obj_file.c_str()); } @@ -371,8 +570,9 @@ static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, // Ignore the return value of this function; even without call frame // information, the other debugging information could be perfectly // useful. + info->LoadedSection(".debug_frame"); LoadDwarfCFI(obj_file, elf_header, ".debug_frame", - dwarf_cfi_section, false, 0, 0, module); + dwarf_cfi_section, false, 0, 0, big_endian, module); } // Linux C++ exception handling information can also provide @@ -388,72 +588,42 @@ static bool LoadSymbols(const std::string &obj_file, ElfW(Ehdr) *elf_header, const ElfW(Shdr) *text_section = FindSectionByName(".text", sections, section_names, elf_header->e_shnum); + info->LoadedSection(".eh_frame"); // As above, ignore the return value of this function. - LoadDwarfCFI(obj_file, elf_header, ".eh_frame", - eh_frame_section, true, got_section, text_section, module); + LoadDwarfCFI(obj_file, elf_header, ".eh_frame", eh_frame_section, true, + got_section, text_section, big_endian, module); } if (!found_debug_info_section) { fprintf(stderr, "%s: file contains no debugging information" " (no \".stab\" or \".debug_info\" sections)\n", obj_file.c_str()); + + // Failed, but maybe we can find a .gnu_debuglink section? + if (read_gnu_debug_link) { + const ElfW(Shdr) *gnu_debuglink_section + = FindSectionByName(".gnu_debuglink", sections, section_names, + elf_header->e_shnum); + if (gnu_debuglink_section) { + if (!info->debug_dir().empty()) { + std::string debuglink_file = + ReadDebugLink(gnu_debuglink_section, obj_file, info->debug_dir()); + info->set_debuglink_file(debuglink_file); + } else { + fprintf(stderr, ".gnu_debuglink section found in '%s', " + "but no debug path specified.\n", obj_file.c_str()); + } + } else { + fprintf(stderr, "%s does not contain a .gnu_debuglink section.\n", + obj_file.c_str()); + } + } return false; } + return true; } -// -// FDWrapper -// -// Wrapper class to make sure opened file is closed. -// -class FDWrapper { - public: - explicit FDWrapper(int fd) : - fd_(fd) { - } - ~FDWrapper() { - if (fd_ != -1) - close(fd_); - } - int get() { - return fd_; - } - int release() { - int fd = fd_; - fd_ = -1; - return fd; - } - private: - int fd_; -}; - -// -// MmapWrapper -// -// Wrapper class to make sure mapped regions are unmapped. -// -class MmapWrapper { - public: - MmapWrapper(void *mapped_address, size_t mapped_size) : - base_(mapped_address), size_(mapped_size) { - } - ~MmapWrapper() { - if (base_ != NULL) { - assert(size_ > 0); - munmap(base_, size_); - } - } - void release() { - base_ = NULL; - size_ = 0; - } - - private: - void *base_; - size_t size_; -}; - // Return the breakpad symbol file identifier for the architecture of // ELF_HEADER. const char *ElfArchitecture(const ElfW(Ehdr) *elf_header) { @@ -506,37 +676,16 @@ std::string BaseFileName(const std::string &filename) { namespace google_breakpad { -bool WriteSymbolFile(const std::string &obj_file, FILE *sym_file) { - int obj_fd = open(obj_file.c_str(), O_RDONLY); - if (obj_fd < 0) { - fprintf(stderr, "Failed to open ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); +bool WriteSymbolFile(const std::string &obj_file, + const std::string &debug_dir, FILE *sym_file) { + MmapWrapper map_wrapper; + ElfW(Ehdr) *elf_header = NULL; + if (!LoadELF(obj_file, &map_wrapper, &elf_header)) return false; - } - FDWrapper obj_fd_wrapper(obj_fd); - struct stat st; - if (fstat(obj_fd, &st) != 0 && st.st_size <= 0) { - fprintf(stderr, "Unable to fstat ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); - return false; - } - void *obj_base = mmap(NULL, st.st_size, - PROT_READ | PROT_WRITE, MAP_PRIVATE, obj_fd, 0); - if (obj_base == MAP_FAILED) { - fprintf(stderr, "Failed to mmap ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); - return false; - } - MmapWrapper map_wrapper(obj_base, st.st_size); - ElfW(Ehdr) *elf_header = reinterpret_cast(obj_base); - if (!IsValidElf(elf_header)) { - fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); - return false; - } unsigned char identifier[16]; google_breakpad::FileID file_id(obj_file.c_str()); - if (!file_id.ElfFileIdentifier(identifier)) { + if (!file_id.ElfFileIdentifierFromMappedFile(elf_header, identifier)) { fprintf(stderr, "%s: unable to generate file identifier\n", obj_file.c_str()); return false; @@ -549,13 +698,57 @@ bool WriteSymbolFile(const std::string &obj_file, FILE *sym_file) { return false; } + // Figure out what endianness this file is. + bool big_endian; + if (!ElfEndianness(elf_header, &big_endian)) + return false; + std::string name = BaseFileName(obj_file); std::string os = "Linux"; std::string id = FormatIdentifier(identifier); + LoadSymbolsInfo info(debug_dir); Module module(name, os, architecture, id); - if (!LoadSymbols(obj_file, elf_header, &module)) - return false; + if (!LoadSymbols(obj_file, big_endian, elf_header, true, &info, &module)) { + const std::string debuglink_file = info.debuglink_file(); + if (debuglink_file.empty()) + return false; + + // Load debuglink ELF file. + fprintf(stderr, "Found debugging info in %s\n", debuglink_file.c_str()); + MmapWrapper debug_map_wrapper; + ElfW(Ehdr) *debug_elf_header = NULL; + if (!LoadELF(debuglink_file, &debug_map_wrapper, &debug_elf_header)) + return false; + // Sanity checks to make sure everything matches up. + const char *debug_architecture = ElfArchitecture(debug_elf_header); + if (!debug_architecture) { + fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n", + debuglink_file.c_str(), debug_elf_header->e_machine); + return false; + } + if (strcmp(architecture, debug_architecture)) { + fprintf(stderr, "%s with ELF machine architecture %s does not match " + "%s with ELF architecture %s\n", + debuglink_file.c_str(), debug_architecture, + obj_file.c_str(), architecture); + return false; + } + + bool debug_big_endian; + if (!ElfEndianness(debug_elf_header, &debug_big_endian)) + return false; + if (debug_big_endian != big_endian) { + fprintf(stderr, "%s and %s does not match in endianness\n", + obj_file.c_str(), debuglink_file.c_str()); + return false; + } + + if (!LoadSymbols(debuglink_file, debug_big_endian, debug_elf_header, + false, &info, &module)) { + return false; + } + } if (!module.Write(sym_file)) return false; diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h index 5422b1c8f7c..e1a930aca27 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h @@ -44,7 +44,10 @@ namespace google_breakpad { // Find all the debugging information in OBJ_FILE, an ELF executable // or shared library, and write it to SYM_FILE in the Breakpad symbol // file format. -bool WriteSymbolFile(const std::string &obj_file, FILE *sym_file); +// If OBJ_FILE has been stripped but contains a .gnu_debuglink section, +// then look for the debug file in DEBUG_DIR. +bool WriteSymbolFile(const std::string &obj_file, + const std::string &debug_dir, FILE *sym_file); } // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/memory.h b/toolkit/crashreporter/google-breakpad/src/common/linux/memory.h index f10a194b47a..725ed8b30c3 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/memory.h +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/memory.h @@ -148,6 +148,24 @@ class wasteful_vector { return used_; } + void resize(unsigned sz, T c = T()) { + // No need to test "sz >= 0", as "sz" is unsigned. + if (sz <= used_) { + used_ = sz; + } else { + unsigned a = allocated_; + if (sz > a) { + while (sz > a) { + a *= 2; + } + Realloc(a); + } + while (sz > used_) { + a_[used_++] = c; + } + } + } + T& operator[](size_t index) { return a_[index]; } diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig new file mode 100644 index 00000000000..3062bbacd2e --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig @@ -0,0 +1,57 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ARCHS = $(ARCHS_STANDARD_32_64_BIT) +SDKROOT = macosx10.5 +SDKROOT[arch=i386] = macosx10.4 +SDKROOT[arch=ppc] = macosx10.4 + +GCC_VERSION = 4.2 +GCC_VERSION[sdk=macosx10.4][arch=*] = 4.0 + +GCC_C_LANGUAGE_STANDARD = c99 + +GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +// TODO(nealsid): Get the code so we can turn on the 64_TO_32 warning. +GCC_WARN_64_TO_32_BIT_CONVERSION = NO +GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES +GCC_WARN_MISSING_PARENTHESES = YES +GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_SIGN_COMPARE = YES +GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES +GCC_WARN_UNDECLARED_SELECTOR = YES +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_VARIABLE = YES +GCC_TREAT_WARNINGS_AS_ERRORS = YES + +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym + +ALWAYS_SEARCH_USER_PATHS = NO diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig new file mode 100644 index 00000000000..94cdd8cfca8 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig @@ -0,0 +1,32 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "Breakpad.xcconfig" + +GCC_OPTIMIZATION_LEVEL = 0 diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig new file mode 100644 index 00000000000..af209a423ce --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig @@ -0,0 +1,33 @@ +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "Breakpad.xcconfig" + +GCC_OPTIMIZATION_LEVEL = s +GCC_WARN_UNINITIALIZED_AUTOS = YES diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m b/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m index dd3612d86fc..eee66a9c940 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m @@ -28,6 +28,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "HTTPMultipartUpload.h" +#import "GTMDefines.h" @interface HTTPMultipartUpload(PrivateMethods) - (NSString *)multipartBoundary; @@ -148,7 +149,6 @@ timeoutInterval:10.0 ]; NSMutableData *postBody = [NSMutableData data]; - int i, count; [req setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary_] forHTTPHeaderField:@"Content-type"]; @@ -157,8 +157,8 @@ NSArray *parameterKeys = [parameters_ allKeys]; NSString *key; - count = [parameterKeys count]; - for (i = 0; i < count; ++i) { + NSInteger count = [parameterKeys count]; + for (NSInteger i = 0; i < count; ++i) { key = [parameterKeys objectAtIndex:i]; [postBody appendData:[self formDataForKey:key value:[parameters_ objectForKey:key]]]; @@ -167,7 +167,7 @@ // Add any files to the message NSArray *fileNames = [files_ allKeys]; count = [fileNames count]; - for (i = 0; i < count; ++i) { + for (NSInteger i = 0; i < count; ++i) { NSString *name = [fileNames objectAtIndex:i]; id fileOrData = [files_ objectForKey:name]; NSData *fileData; diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h index 89924123f62..2213fc6bf54 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h @@ -94,6 +94,7 @@ // kern_return_t result = sender.SendMessage(message, 1000); // timeout 1000ms // +namespace google_breakpad { #define PRINT_MACH_RESULT(result_, message_) \ printf(message_" %s (%d)\n", mach_error_string(result_), result_ ); @@ -224,7 +225,7 @@ class MachMessage { void SetDescriptor(int n, const MachMsgPortDescriptor &desc); // Returns total message size setting msgh_size in the header to this value - int CalculateSize(); + mach_msg_size_t CalculateSize(); mach_msg_header_t head; mach_msg_body_t body; @@ -255,11 +256,11 @@ class MachSendMessage : public MachMessage { class ReceivePort { public: // Creates a new mach port for receiving messages and registers a name for it - 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. - ReceivePort(mach_port_t receive_port); + explicit ReceivePort(mach_port_t receive_port); // Create a new mach port for receiving messages ReceivePort(); @@ -285,11 +286,11 @@ class ReceivePort { class MachPortSender { public: // get a port with send rights corresponding to a named registered service - MachPortSender(const char *receive_port_name); + explicit MachPortSender(const char *receive_port_name); // Given an already existing mach port, use it. - MachPortSender(mach_port_t send_port); + explicit MachPortSender(mach_port_t send_port); kern_return_t SendMessage(MachSendMessage &message, mach_msg_timeout_t timeout); @@ -301,4 +302,6 @@ class MachPortSender { kern_return_t init_result_; }; +} // namespace google_breakpad + #endif // MACH_IPC_H__ diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm index 9e521e48ec0..4f58c02d686 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm @@ -33,6 +33,7 @@ #import #import "MachIPC.h" +namespace google_breakpad { //============================================================================== MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); @@ -53,10 +54,10 @@ MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { bool MachMessage::SetData(void *data, int32_t data_length) { // first check to make sure we have enough space - int size = CalculateSize(); - int new_size = size + data_length; + size_t size = CalculateSize(); + size_t new_size = size + data_length; - if ((unsigned)new_size > sizeof(MachMessage)) { + if (new_size > sizeof(MachMessage)) { return false; // not enough space } @@ -72,8 +73,8 @@ bool MachMessage::SetData(void *data, // calculates and returns the total size of the message // Currently, the entire message MUST fit inside of the MachMessage // messsage size <= sizeof(MachMessage) -int MachMessage::CalculateSize() { - int size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); +mach_msg_size_t MachMessage::CalculateSize() { + size_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); // add space for MessageDataPacket int32_t alignedDataLength = (GetDataLength() + 3) & ~0x3; @@ -82,14 +83,14 @@ int MachMessage::CalculateSize() { // add space for descriptors size += GetDescriptorCount() * sizeof(MachMsgPortDescriptor); - head.msgh_size = size; + head.msgh_size = static_cast(size); - return size; + return head.msgh_size; } //============================================================================== MachMessage::MessageDataPacket *MachMessage::GetDataPacket() { - int desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount(); + size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount(); MessageDataPacket *packet = reinterpret_cast(padding + desc_size); @@ -109,9 +110,9 @@ void MachMessage::SetDescriptor(int n, bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) { // first check to make sure we have enough space int size = CalculateSize(); - int new_size = size + sizeof(MachMsgPortDescriptor); + size_t new_size = size + sizeof(MachMsgPortDescriptor); - if ((unsigned)new_size > sizeof(MachMessage)) { + if (new_size > sizeof(MachMessage)) { return false; // not enough space } @@ -180,8 +181,8 @@ ReceivePort::ReceivePort(const char *receive_port_name) { if (init_result_ != KERN_SUCCESS) return; - mach_port_t bootstrap_port = 0; - init_result_ = task_get_bootstrap_port(current_task, &bootstrap_port); + mach_port_t task_bootstrap_port = 0; + init_result_ = task_get_bootstrap_port(current_task, &task_bootstrap_port); if (init_result_ != KERN_SUCCESS) return; @@ -240,8 +241,11 @@ kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message, out_message->head.msgh_reserved = 0; out_message->head.msgh_id = 0; + mach_msg_option_t options = MACH_RCV_MSG; + if (timeout != MACH_MSG_TIMEOUT_NONE) + options |= MACH_RCV_TIMEOUT; kern_return_t result = mach_msg(&out_message->head, - MACH_RCV_MSG | MACH_RCV_TIMEOUT, + options, 0, sizeof(MachMessage), port_, @@ -256,13 +260,14 @@ 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) { - mach_port_t bootstrap_port = 0; - init_result_ = task_get_bootstrap_port(mach_task_self(), &bootstrap_port); + mach_port_t task_bootstrap_port = 0; + init_result_ = task_get_bootstrap_port(mach_task_self(), + &task_bootstrap_port); if (init_result_ != KERN_SUCCESS) return; - init_result_ = bootstrap_look_up(bootstrap_port, + init_result_ = bootstrap_look_up(task_bootstrap_port, const_cast(receive_port_name), &send_port_); } @@ -295,3 +300,5 @@ kern_return_t MachPortSender::SendMessage(MachSendMessage &message, return result; } + +} // namespace google_breakpad diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h index f2bee65745b..fbf11c783fe 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h @@ -83,7 +83,17 @@ class DumpSymbols { // object file, then the dumper will dump the object file whose // architecture matches that of this dumper program. bool SetArchitecture(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); - + + // If this dumper's file includes an object file for |arch_name|, then select + // that object file for dumping, and return true. Otherwise, return false, + // and leave this dumper's selected architecture unchanged. + // + // By default, if this dumper's file contains only one object file, then + // 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); + // Return a pointer to an array of 'struct fat_arch' structures, // describing the object files contained in this dumper's file. Set // *|count| to the number of elements in the array. The returned array is diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.mm b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.mm index ab2f2b9e772..cc2efe17378 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.mm +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.mm @@ -54,6 +54,10 @@ #include "common/stabs_reader.h" #include "common/stabs_to_module.h" +#ifndef CPU_TYPE_ARM +#define CPU_TYPE_ARM (static_cast(12)) +#endif // CPU_TYPE_ARM + using dwarf2reader::ByteReader; using google_breakpad::DwarfCUToModule; using google_breakpad::DwarfLineToModule; @@ -176,7 +180,7 @@ bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, // Find the best match for the architecture the user requested. const struct fat_arch *best_match = NXFindBestFatArch(cpu_type, cpu_subtype, &object_files_[0], - object_files_.size()); + static_cast(object_files_.size())); if (!best_match) return false; // Record the selected object file. @@ -184,6 +188,15 @@ bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, return true; } +bool DumpSymbols::SetArchitecture(const std::string &arch_name) { + bool arch_set = false; + const NXArchInfo *arch_info = NXGetArchInfoFromName(arch_name.c_str()); + if (arch_info) { + arch_set = SetArchitecture(arch_info->cputype, arch_info->cpusubtype); + } + return arch_set; +} + string DumpSymbols::Identifier() { FileID file_id([object_filename_ fileSystemRepresentation]); unsigned char identifier_bytes[16]; @@ -436,12 +449,16 @@ bool DumpSymbols::WriteSymbolFile(FILE *stream) { = NXGetArchInfoFromCpuType(selected_object_file_->cputype, selected_object_file_->cpusubtype); + const char *selected_arch_name = selected_arch_info->name; + if (strcmp(selected_arch_name, "i386") == 0) + selected_arch_name = "x86"; + // Produce a name to use in error messages that includes the // filename, and the architecture, if there is more than one. selected_object_name_ = [object_filename_ UTF8String]; if (object_files_.size() > 1) { selected_object_name_ += ", architecture "; - selected_object_name_ + selected_arch_info->name; + selected_object_name_ + selected_arch_name; } // Compute a module name, to appear in the MODULE record. @@ -454,7 +471,7 @@ bool DumpSymbols::WriteSymbolFile(FILE *stream) { identifier += "0"; // Create a module to hold the debugging information. - Module module([module_name UTF8String], "mac", selected_arch_info->name, + Module module([module_name UTF8String], "mac", selected_arch_name, identifier); // Parse the selected object file. diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc index 160f6ed7510..486cf53625a 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc @@ -53,7 +53,12 @@ extern "C" { // necessary for Leopard namespace MacFileUtilities { -MachoID::MachoID(const char *path) { +MachoID::MachoID(const char *path) + : file_(0), + crc_(0), + md5_context_(), + sha1_context_(), + update_function_(NULL) { strlcpy(path_, path, sizeof(path_)); file_ = open(path, O_RDONLY); } @@ -119,7 +124,7 @@ void MachoID::UpdateSHA1(unsigned char *bytes, size_t size) { SHA_Update(&sha1_context_, bytes, size); } -void MachoID::Update(MachoWalker *walker, unsigned long offset, size_t size) { +void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) { if (!update_function_ || !size) return; @@ -182,7 +187,7 @@ bool MachoID::IDCommand(int cpu_type, unsigned char identifier[16]) { identifier[2] = 0; identifier[3] = 0; - for (int j = 0, i = strlen(path_)-1; i >= 0 && path_[i]!='/'; ++j, --i) { + for (int j = 0, i = (int)strlen(path_)-1; i>=0 && path_[i]!='/'; ++j, --i) { identifier[j%4] += path_[i]; } @@ -313,7 +318,9 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, // sections of type S_ZEROFILL are "virtual" and contain no data // in the file itself if ((sec64.flags & SECTION_TYPE) != S_ZEROFILL && sec64.offset != 0) - macho_id->Update(walker, header_offset + sec64.offset, sec64.size); + macho_id->Update(walker, + header_offset + sec64.offset, + (size_t)sec64.size); offset += sizeof(struct section_64); } diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h index 039bba3889a..ea01a6d7a97 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h @@ -86,7 +86,7 @@ class MachoID { void UpdateSHA1(unsigned char *bytes, size_t size); // Bottleneck for update routines - void Update(MachoWalker *walker, unsigned long offset, size_t size); + void Update(MachoWalker *walker, off_t offset, size_t size); // The callback from the MachoWalker for CRC, MD5, and SHA1 static bool WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc index 53da1807366..ff16bc61743 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc @@ -130,7 +130,7 @@ bool FatReader::Read(const uint8_t *buffer, size_t size) { } object_files_[0].offset = 0; - object_files_[0].size = buffer_.Size(); + object_files_[0].size = static_cast(buffer_.Size()); // This alignment is correct for 32 and 64-bit x86 and ppc. // See get_align in the lipo source for other architectures: // http://www.opensource.apple.com/source/cctools/cctools-773/misc/lipo.c diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc index 4e478d79c0b..9bc6d25a5c4 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc @@ -992,7 +992,7 @@ TEST_F(LoadCommand, None) { EXPECT_FALSE(reader.big_endian()); EXPECT_EQ(CPU_TYPE_X86, reader.cpu_type()); EXPECT_EQ(CPU_SUBTYPE_I386_ALL, reader.cpu_subtype()); - EXPECT_EQ(MH_EXECUTE, reader.file_type()); + EXPECT_EQ(static_cast(MH_EXECUTE), reader.file_type()); EXPECT_EQ(FileFlags(MH_TWOLEVEL | MH_DYLDLINK | MH_NOUNDEFS), @@ -1018,7 +1018,7 @@ TEST_F(LoadCommand, Unknown) { EXPECT_TRUE(reader.big_endian()); EXPECT_EQ(CPU_TYPE_X86, reader.cpu_type()); EXPECT_EQ(CPU_SUBTYPE_I386_ALL, reader.cpu_subtype()); - EXPECT_EQ(MH_EXECUTE, reader.file_type()); + EXPECT_EQ(static_cast(MH_EXECUTE), reader.file_type()); EXPECT_EQ(FileFlags(MH_TWOLEVEL | MH_DYLDLINK | MH_NOUNDEFS), diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc index ecea899774c..3e8fe211dd3 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc @@ -51,8 +51,12 @@ namespace MacFileUtilities { MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback, void *context) - : callback_(callback), - callback_context_(context) { + : file_(0), + callback_(callback), + callback_context_(context), + current_header_(NULL), + current_header_size_(0), + current_header_offset_(0) { file_ = open(path, O_RDONLY); } @@ -95,7 +99,7 @@ bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) { *offset = current_header_offset_; return true; } - + return false; } @@ -111,7 +115,7 @@ bool MachoWalker::FindHeader(int cpu_type, off_t &offset) { // Figure out what type of file we've got bool is_fat = false; if (magic == FAT_MAGIC || magic == FAT_CIGAM) { - is_fat = true; + is_fat = true; } else if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 && magic != MH_CIGAM_64) { @@ -174,13 +178,13 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) { bool swap = (header.magic == MH_CIGAM); if (swap) swap_mach_header(&header, NXHostByteOrder()); - + // 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)); header64.reserved = 0; - + current_header_ = &header64; current_header_size_ = sizeof(header); // 32-bit, not 64-bit current_header_offset_ = offset; diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h index 6445a4f4010..0d30b5c05fd 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h @@ -99,6 +99,10 @@ class MachoWalker { struct mach_header_64 *current_header_; unsigned long current_header_size_; off_t current_header_offset_; + + private: + MachoWalker(const MachoWalker &); + MachoWalker &operator=(const MachoWalker &); }; } // namespace MacFileUtilities diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h b/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h new file mode 100644 index 00000000000..d6d1bef9717 --- /dev/null +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h @@ -0,0 +1,56 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Inline implementation of ScopedTaskSuspend, which suspends a Mach +// task for the duration of its scope. + +#ifndef GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ +#define GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ + +#include + +namespace google_breakpad { + +class ScopedTaskSuspend { + public: + explicit ScopedTaskSuspend(mach_port_t target) : target_(target) { + task_suspend(target_); + } + + ~ScopedTaskSuspend() { + task_resume(target_); + } + + private: + mach_port_t target_; +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc index 5a89be38cbf..e1f63a98ccd 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc @@ -58,7 +58,7 @@ unsigned int IntegerValueAtIndex(string &str, unsigned int idx) { size_t start = 0; size_t end; size_t found = 0; - size_t result = 0; + unsigned int result = 0; for (; found <= idx; ++found) { end = str.find_first_not_of(digits, start); diff --git a/toolkit/crashreporter/google-breakpad/src/common/module.cc b/toolkit/crashreporter/google-breakpad/src/common/module.cc index f7f5788e37d..c980b96fe75 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/module.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/module.cc @@ -49,7 +49,7 @@ Module::Module(const string &name, const string &os, Module::~Module() { for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); it++) delete it->second; - for (vector::iterator it = functions_.begin(); + for (FunctionSet::iterator it = functions_.begin(); it != functions_.end(); it++) delete *it; for (vector::iterator it = stack_frame_entries_.begin(); @@ -62,12 +62,17 @@ void Module::SetLoadAddress(Address address) { } void Module::AddFunction(Function *function) { - functions_.push_back(function); + std::pair ret = functions_.insert(function); + if (!ret.second) { + // Free the duplicate we failed to insert because we own it. + delete function; + } } void Module::AddFunctions(vector::iterator begin, vector::iterator end) { - functions_.insert(functions_.end(), begin, end); + for (vector::iterator it = begin; it != end; it++) + AddFunction(*it); } void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) { @@ -130,7 +135,7 @@ void Module::AssignSourceIds() { // Next, mark all files actually cited by our functions' line number // info, by setting each one's source id to zero. - for (vector::const_iterator func_it = functions_.begin(); + for (FunctionSet::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) { Function *func = *func_it; for (vector::iterator line_it = func->lines.begin(); @@ -145,13 +150,13 @@ void Module::AssignSourceIds() { int next_source_id = 0; for (FileByNameMap::iterator file_it = files_.begin(); file_it != files_.end(); file_it++) - if (! file_it->second->source_id) + if (!file_it->second->source_id) file_it->second->source_id = next_source_id++; } bool Module::ReportError() { fprintf(stderr, "error writing symbol file: %s\n", - strerror (errno)); + strerror(errno)); return false; } @@ -187,7 +192,7 @@ bool Module::Write(FILE *stream) { } // Write out functions and their lines. - for (vector::const_iterator func_it = functions_.begin(); + for (FunctionSet::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) { Function *func = *func_it; if (0 > fprintf(stream, "FUNC %llx %llx %llx %s\n", @@ -217,7 +222,7 @@ bool Module::Write(FILE *stream) { || !WriteRuleMap(entry->initial_rules, stream) || 0 > putc('\n', stream)) return ReportError(); - + // Write out this entry's delta rules as 'STACK CFI' records. for (RuleChangeMap::const_iterator delta_it = entry->rule_changes.begin(); delta_it != entry->rule_changes.end(); delta_it++) { diff --git a/toolkit/crashreporter/google-breakpad/src/common/module.h b/toolkit/crashreporter/google-breakpad/src/common/module.h index 64707f3fd6d..8c20cea0181 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/module.h +++ b/toolkit/crashreporter/google-breakpad/src/common/module.h @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -48,6 +49,7 @@ namespace google_breakpad { +using std::set; using std::string; using std::vector; using std::map; @@ -90,7 +92,7 @@ class Module { // The function's name. string name; - + // The start address and length of the function's code. Address address, size; @@ -124,7 +126,7 @@ class Module { // A map from addresses to RuleMaps, representing changes that take // effect at given addresses. typedef map RuleChangeMap; - + // A range of 'STACK CFI' stack walking information. An instance of // this structure corresponds to a 'STACK CFI INIT' record and the // subsequent 'STACK CFI' records that fall within its range. @@ -143,10 +145,19 @@ class Module { // including the address you're interested in. RuleChangeMap rule_changes; }; - + + struct FunctionCompare { + bool operator() (const Function *lhs, + const Function *rhs) const { + if (lhs->address == rhs->address) + return lhs->name < rhs->name; + 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, + Module(const string &name, const string &os, const string &architecture, const string &id); ~Module(); @@ -176,7 +187,7 @@ class Module { vector::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); @@ -258,12 +269,13 @@ class Module { // A map from filenames to File structures. The map's keys are // pointers to the Files' names. typedef map FileByNameMap; + typedef set FunctionSet; // The module owns all the files and functions that have been added // to it; destroying the module frees the Files and Functions these // point to. - FileByNameMap files_; // This module's source files. - vector functions_; // This module's functions. + FileByNameMap files_; // This module's source files. + FunctionSet functions_; // This module's functions. // The module owns all the call frame info entries that have been // added to it. diff --git a/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc index 18c8ad61aad..24189944ee2 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc @@ -49,7 +49,7 @@ using testing::ContainerEq; // Return a FILE * referring to a temporary file that will be deleted // automatically when the stream is closed or the program exits. -FILE *checked_tmpfile() { +static FILE *checked_tmpfile() { FILE *f = tmpfile(); if (!f) { fprintf(stderr, "error creating temporary file: %s\n", strerror(errno)); @@ -60,7 +60,7 @@ FILE *checked_tmpfile() { // Read from STREAM until end of file, and return the contents as a // string. -string checked_read(FILE *stream) { +static string checked_read(FILE *stream) { string contents; int c; while ((c = getc(stream)) != EOF) @@ -74,7 +74,7 @@ string checked_read(FILE *stream) { } // Apply 'fflush' to STREAM, and check for errors. -void checked_fflush(FILE *stream) { +static void checked_fflush(FILE *stream) { if (fflush(stream) == EOF) { fprintf(stderr, "error flushing temporary file stream: %s\n", strerror(errno)); @@ -83,7 +83,7 @@ void checked_fflush(FILE *stream) { } // Apply 'fclose' to STREAM, and check for errors. -void checked_fclose(FILE *stream) { +static void checked_fclose(FILE *stream) { if (fclose(stream) == EOF) { fprintf(stderr, "error closing temporary file stream: %s\n", strerror(errno)); @@ -91,6 +91,19 @@ void checked_fclose(FILE *stream) { } } +static Module::Function *generate_duplicate_function(const string &name) { + const Module::Address DUP_ADDRESS = 0xd35402aac7a7ad5cLL; + const Module::Address DUP_SIZE = 0x200b26e605f99071LL; + const Module::Address DUP_PARAMETER_SIZE = 0xf14ac4fed48c4a99LL; + + Module::Function *function = new(Module::Function); + function->name = name; + function->address = DUP_ADDRESS; + function->size = DUP_SIZE; + function->parameter_size = DUP_PARAMETER_SIZE; + return function; +} + #define MODULE_NAME "name with spaces" #define MODULE_OS "os-name" #define MODULE_ARCH "architecture" @@ -222,7 +235,7 @@ TEST(Write, OmitUnusedFiles) { m.AddFunction(function); m.AssignSourceIds(); - + vector vec; m.GetFiles(&vec); EXPECT_EQ((size_t) 3, vec.size()); @@ -280,10 +293,10 @@ TEST(Construct, AddFunctions) { string contents = checked_read(f); checked_fclose(f); EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n" - "FUNC d35024aa7ca7da5c 200b26e605f99071 f14ac4fed48c4a99" - " _without_form\n" "FUNC 2987743d0b35b13f b369db048deb3010 938e556cb5a79988" - " _and_void\n", + " _and_void\n" + "FUNC d35024aa7ca7da5c 200b26e605f99071 f14ac4fed48c4a99" + " _without_form\n", contents.c_str()); // Check that m.GetFunctions returns the functions we expect. @@ -303,7 +316,7 @@ TEST(Construct, AddFrames) { entry1->address = 0xddb5f41285aa7757ULL; entry1->size = 0x1486493370dc5073ULL; m.AddStackFrameEntry(entry1); - + // Second STACK CFI entry, with initial rules but no deltas. Module::StackFrameEntry *entry2 = new Module::StackFrameEntry(); entry2->address = 0x8064f3af5e067e38ULL; @@ -396,3 +409,49 @@ TEST(Construct, UniqueFiles) { EXPECT_EQ(file1, m.FindExistingFile("foo")); EXPECT_TRUE(m.FindExistingFile("baz") == NULL); } + +TEST(Construct, DuplicateFunctions) { + FILE *f = checked_tmpfile(); + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); + + // Two functions. + Module::Function *function1 = generate_duplicate_function("_without_form"); + Module::Function *function2 = generate_duplicate_function("_without_form"); + + m.AddFunction(function1); + m.AddFunction(function2); + + m.Write(f); + checked_fflush(f); + rewind(f); + string contents = checked_read(f); + checked_fclose(f); + EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n" + "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99" + " _without_form\n", + contents.c_str()); +} + +TEST(Construct, FunctionsWithSameAddress) { + FILE *f = checked_tmpfile(); + Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); + + // Two functions. + Module::Function *function1 = generate_duplicate_function("_without_form"); + Module::Function *function2 = generate_duplicate_function("_and_void"); + + m.AddFunction(function1); + m.AddFunction(function2); + + m.Write(f); + checked_fflush(f); + rewind(f); + string contents = checked_read(f); + checked_fclose(f); + EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n" + "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99" + " _and_void\n" + "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99" + " _without_form\n", + contents.c_str()); +} diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc index fbe4c02f138..62fcd39e083 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc @@ -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::iterator func_it = functions_.begin(); + for (vector::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) delete *func_it; // Free any function that we're currently within. @@ -104,16 +104,8 @@ bool StabsToModule::EndFunction(uint64_t address) { assert(current_function_); // Functions in this compilation unit should have address bigger // than the compilation unit's starting address. There may be a lot - // of duplicated entries for functions in the STABS data; only one - // entry can meet this requirement. - // - // (I don't really understand the above comment; just bringing it along - // from the previous code, and leaving the behavior unchanged. GCC marks - // the end of each function with an N_FUN entry with no name, whose value - // is the size of the function; perhaps this test was concerned with - // skipping those. Now StabsReader interprets them properly. If you know - // the whole story, please patch this comment. --jimb) - // + // of duplicated entries for functions in the STABS data. We will + // count on the Module to remove the duplicates. if (current_function_->address >= comp_unit_base_address_) functions_.push_back(current_function_); else @@ -153,12 +145,13 @@ void StabsToModule::Finalize() { // Sort all functions by address, just for neatness. sort(functions_.begin(), functions_.end(), Module::Function::CompareByAddress); - for (vector::iterator func_it = functions_.begin(); + + for (vector::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) { Module::Function *f = *func_it; // Compute the function f's size. - vector::iterator boundary + vector::const_iterator boundary = std::upper_bound(boundaries_.begin(), boundaries_.end(), f->address); if (boundary != boundaries_.end()) f->size = *boundary - f->address; diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc index 4248b3c0551..2c432a3e237 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc @@ -74,6 +74,38 @@ TEST(StabsToModule, SimpleCU) { EXPECT_EQ(174823314, line->number); } +TEST(StabsToModule, DuplicateFunctionNames) { + Module m("name", "os", "arch", "id"); + StabsToModule h(&m); + + // Compilation unit with one function, mangled name. + EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xf2cfda36ecf7f46cLL, + "build-directory")); + EXPECT_TRUE(h.StartFunction("funcfoo", + 0xf2cfda36ecf7f46dLL)); + EXPECT_TRUE(h.EndFunction(0)); + EXPECT_TRUE(h.StartFunction("funcfoo", + 0xf2cfda36ecf7f46dLL)); + EXPECT_TRUE(h.EndFunction(0)); + EXPECT_TRUE(h.EndCompilationUnit(0)); + + h.Finalize(); + + // Now check to see what has been added to the Module. + Module::File *file = m.FindExistingFile("compilation-unit"); + ASSERT_TRUE(file != NULL); + + vector functions; + m.GetFunctions(&functions, functions.end()); + ASSERT_EQ(1U, functions.size()); + + Module::Function *function = functions[0]; + EXPECT_EQ(0xf2cfda36ecf7f46dLL, function->address); + EXPECT_LT(0U, function->size); // should have used dummy size + EXPECT_EQ(0U, function->parameter_size); + ASSERT_EQ(0U, function->lines.size()); +} + TEST(InferSizes, LineSize) { Module m("name", "os", "arch", "id"); StabsToModule h(&m); @@ -88,7 +120,7 @@ TEST(InferSizes, LineSize) { EXPECT_TRUE(h.EndFunction(0)); // unknown function end address EXPECT_TRUE(h.EndCompilationUnit(0)); // unknown CU end address EXPECT_TRUE(h.StartCompilationUnit("compilation-unit-2", 0xb4523963eff94e92LL, - "build-directory-2")); // next boundary + "build-directory-2")); // next boundary EXPECT_TRUE(h.EndCompilationUnit(0)); h.Finalize(); diff --git a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc b/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc index 50054ebc3b1..5af12f5ac81 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc @@ -68,7 +68,7 @@ int UTF8ToUTF16Char(const char *in, int in_length, u_int16_t out[2]) { strictConversion); if (result == conversionOK) - return source_ptr - reinterpret_cast(in); + return static_cast(source_ptr - reinterpret_cast(in)); // Add another character to the input stream and try again source_ptr = reinterpret_cast(in); @@ -135,7 +135,7 @@ string UTF16ToUTF8(const vector &in, bool swap) { // The maximum expansion would be 4x the size of the input string. const UTF16 *source_end_ptr = source_ptr + in.size(); - int target_capacity = in.size() * 4; + size_t target_capacity = in.size() * 4; scoped_array target_buffer(new UTF8[target_capacity]); UTF8 *target_ptr = target_buffer.get(); UTF8 *target_end_ptr = target_ptr + target_capacity; @@ -145,8 +145,7 @@ string UTF16ToUTF8(const vector &in, bool swap) { if (result == conversionOK) { const char *targetPtr = reinterpret_cast(target_buffer.get()); - string result(targetPtr); - return result; + return targetPtr; } return ""; diff --git a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc b/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc index 3271176cfa0..7f5dd384a0b 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc @@ -96,7 +96,7 @@ u_int64_t Label::operator-(const Label &label) const { } u_int64_t Label::Value() const { - u_int64_t v; + u_int64_t v = 0; ALWAYS_EVALUATE_AND_ASSERT(IsKnownConstant(&v)); return v; }; diff --git a/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc index c26a93830fc..5db1326783a 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc @@ -37,10 +37,10 @@ #include "breakpad_googletest_includes.h" #include "common/test_assembler.h" -using google_breakpad::TestAssembler::Label; -using google_breakpad::TestAssembler::Section; -using google_breakpad::TestAssembler::kBigEndian; -using google_breakpad::TestAssembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; +using google_breakpad::test_assembler::kBigEndian; +using google_breakpad::test_assembler::kLittleEndian; using std::string; using testing::Test; diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc index afbc4879c1b..9b459ccc76c 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc @@ -61,8 +61,8 @@ using google_breakpad::SynthMinidump::Stream; using google_breakpad::SynthMinidump::String; using google_breakpad::SynthMinidump::SystemInfo; using google_breakpad::SynthMinidump::Thread; -using google_breakpad::TestAssembler::kBigEndian; -using google_breakpad::TestAssembler::kLittleEndian; +using google_breakpad::test_assembler::kBigEndian; +using google_breakpad::test_assembler::kLittleEndian; using std::ifstream; using std::istringstream; using std::string; diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc index 6db04ffc334..40448640586 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc @@ -51,9 +51,9 @@ using google_breakpad::StackFrame; using google_breakpad::StackFrameAMD64; using google_breakpad::StackwalkerAMD64; using google_breakpad::SystemInfo; -using google_breakpad::TestAssembler::kLittleEndian; -using google_breakpad::TestAssembler::Label; -using google_breakpad::TestAssembler::Section; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; using std::string; using std::vector; using testing::_; diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc index 036b322cbf4..a12d4eb9db7 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc @@ -53,9 +53,9 @@ using google_breakpad::StackFrameARM; using google_breakpad::StackwalkerARM; using google_breakpad::SystemInfo; using google_breakpad::WindowsFrameInfo; -using google_breakpad::TestAssembler::kLittleEndian; -using google_breakpad::TestAssembler::Label; -using google_breakpad::TestAssembler::Section; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; using std::string; using std::vector; using testing::_; diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc index f1eac7c2895..7363abd5690 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc @@ -93,7 +93,7 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack *stack) { // A caller frame must reside higher in memory than its callee frames. // Anything else is an error, or an indication that we've reached the // end of the stack. - u_int32_t stack_pointer = last_frame->context.g_r[30]; + u_int64_t stack_pointer = last_frame->context.g_r[30]; if (stack_pointer <= last_frame->context.g_r[14]) { return NULL; } diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc index 5af516d413b..36c84d023ba 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc @@ -52,9 +52,9 @@ using google_breakpad::StackFrameX86; using google_breakpad::StackwalkerX86; using google_breakpad::SystemInfo; using google_breakpad::WindowsFrameInfo; -using google_breakpad::TestAssembler::kLittleEndian; -using google_breakpad::TestAssembler::Label; -using google_breakpad::TestAssembler::Section; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; +using google_breakpad::test_assembler::Section; using std::string; using std::vector; using testing::_; diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc index c25d421fe7e..cebc0a6a238 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc @@ -38,16 +38,16 @@ namespace google_breakpad { namespace SynthMinidump { Section::Section(const Dump &dump) - : TestAssembler::Section(dump.endianness()) { } + : test_assembler::Section(dump.endianness()) { } -void Section::CiteLocationIn(TestAssembler::Section *section) const { +void Section::CiteLocationIn(test_assembler::Section *section) const { if (this) (*section).D32(size_).D32(file_offset_); else (*section).D32(0).D32(0); } -void Stream::CiteStreamIn(TestAssembler::Section *section) const { +void Stream::CiteStreamIn(test_assembler::Section *section) const { section->D32(type_); CiteLocationIn(section); } @@ -114,11 +114,11 @@ String::String(const Dump &dump, const string &contents) : Section(dump) { D16(*i); } -void String::CiteStringIn(TestAssembler::Section *section) const { +void String::CiteStringIn(test_assembler::Section *section) const { section->D32(file_offset_); } -void Memory::CiteMemoryIn(TestAssembler::Section *section) const { +void Memory::CiteMemoryIn(test_assembler::Section *section) const { section->D64(address_); CiteLocationIn(section); } @@ -237,7 +237,7 @@ Dump::Dump(u_int64_t flags, Endianness endianness, u_int32_t version, u_int32_t date_time_stamp) - : TestAssembler::Section(endianness), + : test_assembler::Section(endianness), file_start_(0), stream_directory_(*this), stream_count_(0), @@ -301,7 +301,7 @@ void Dump::Finish() { // has the stream count and MDRVA. stream_count_label_ = stream_count_; stream_directory_rva_ = file_start_ + Size(); - Append(static_cast(stream_directory_)); + Append(static_cast(stream_directory_)); } } // namespace SynthMinidump diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h index 6219272d413..f09a68fc5fb 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h +++ b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h @@ -34,13 +34,13 @@ // synth_minidump.h: Interface to SynthMinidump: fake minidump generator. // // We treat a minidump file as the concatenation of a bunch of -// TestAssembler::Sections. The file header, stream directory, +// test_assembler::Sections. The file header, stream directory, // streams, memory regions, strings, and so on --- each is a Section // that eventually gets appended to the minidump. Dump, Memory, -// Context, Thread, and so on all inherit from TestAssembler::Section. +// Context, Thread, and so on all inherit from test_assembler::Section. // For example: // -// using google_breakpad::TestAssembler::kLittleEndian; +// using google_breakpad::test_assembler::kLittleEndian; // using google_breakpad::SynthMinidump::Context; // using google_breakpad::SynthMinidump::Dump; // using google_breakpad::SynthMinidump::Memory; @@ -49,7 +49,7 @@ // Dump minidump(MD_NORMAL, kLittleEndian); // // Memory stack1(minidump, 0x569eb0a9); -// ... build contents of stack1 with TestAssembler::Section functions ... +// ... build contents of stack1 with test_assembler::Section functions ... // // MDRawContextX86 x86_context1; // x86_context1.context_flags = MD_CONTEXT_X86; @@ -69,7 +69,7 @@ // EXPECT_TRUE(minidump.GetContents(&contents)); // // contents now holds the bytes of a minidump file // -// Because the TestAssembler classes let us write Label references to +// Because the test_assembler classes let us write Label references to // sections before the Labels' values are known, this gives us // flexibility in how we put the dump together: minidump pieces can // hold the file offsets of other minidump pieces before the @@ -103,7 +103,7 @@ // memory list stream. // // If you forget to Add some Section, the Dump::GetContents call will -// fail, as the TestAssembler::Labels used to cite the Section's +// fail, as the test_assembler::Labels used to cite the Section's // contents from elsewhere will still be undefined. #ifndef PROCESSOR_SYNTH_MINIDUMP_H_ #define PROCESSOR_SYNTH_MINIDUMP_H_ @@ -122,18 +122,18 @@ namespace google_breakpad { namespace SynthMinidump { using std::string; -using TestAssembler::Endianness; -using TestAssembler::kBigEndian; -using TestAssembler::kLittleEndian; -using TestAssembler::kUnsetEndian; -using TestAssembler::Label; +using test_assembler::Endianness; +using test_assembler::kBigEndian; +using test_assembler::kLittleEndian; +using test_assembler::kUnsetEndian; +using test_assembler::Label; class Dump; class Memory; class String; -// A TestAssembler::Section which will be appended to a minidump. -class Section: public TestAssembler::Section { +// A test_assembler::Section which will be appended to a minidump. +class Section: public test_assembler::Section { public: explicit Section(const Dump &dump); @@ -145,7 +145,7 @@ class Section: public TestAssembler::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(TestAssembler::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 @@ -165,11 +165,11 @@ class Section: public TestAssembler::Section { class Stream: public Section { public: // Create a stream of type TYPE. You can append whatever contents - // you like to this stream using the TestAssembler::Section methods. + // you like to this stream using the test_assembler::Section methods. Stream(const Dump &dump, u_int32_t type) : Section(dump), type_(type) { } // Append an MDRawDirectory referring to this stream to SECTION. - void CiteStreamIn(TestAssembler::Section *section) const; + void CiteStreamIn(test_assembler::Section *section) const; private: // The type of this stream. @@ -202,7 +202,7 @@ class String: public Section { String(const Dump &dump, const string &value); // Append an MDRVA referring to this string to SECTION. - void CiteStringIn(TestAssembler::Section *section) const; + void CiteStringIn(test_assembler::Section *section) const; }; // A range of memory contents. 'Add'ing a memory range to a minidump @@ -215,7 +215,7 @@ class Memory: public Section { : Section(dump), address_(address) { start() = address; } // Append an MDMemoryDescriptor referring to this memory range to SECTION. - void CiteMemoryIn(TestAssembler::Section *section) const; + void CiteMemoryIn(test_assembler::Section *section) const; private: // The process address from which these memory contents were taken. @@ -297,10 +297,10 @@ class List: public Stream { Label count_label_; }; -class Dump: public TestAssembler::Section { +class Dump: public test_assembler::Section { public: - // Create a TestAssembler::Section containing a minidump file whose + // Create a test_assembler::Section containing a minidump file whose // header uses the given values. ENDIANNESS determines the // endianness of the signature; we set this section's default // endianness by this. diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc index 888053bdb27..adad4ae8a9a 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc @@ -50,9 +50,9 @@ using google_breakpad::SynthMinidump::Stream; using google_breakpad::SynthMinidump::String; using google_breakpad::SynthMinidump::SystemInfo; using google_breakpad::SynthMinidump::Thread; -using google_breakpad::TestAssembler::kBigEndian; -using google_breakpad::TestAssembler::kLittleEndian; -using google_breakpad::TestAssembler::Label; +using google_breakpad::test_assembler::kBigEndian; +using google_breakpad::test_assembler::kLittleEndian; +using google_breakpad::test_assembler::Label; using std::string; TEST(Section, Simple) { diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc index 67f5ad53bf3..7d721a8c6c4 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc +++ b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc @@ -32,17 +32,21 @@ #include "common/linux/dump_symbols.h" -using namespace google_breakpad; +using google_breakpad::WriteSymbolFile; int main(int argc, char **argv) { - if (argc != 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); + if (argc < 2 || argc > 3) { + fprintf(stderr, "Usage: %s " + "[directory-for-debug-file]\n", argv[0]); return 1; } const char *binary = argv[1]; + std::string debug_dir; + if (argc == 3) + debug_dir = argv[2]; - if (!WriteSymbolFile(binary, stdout)) { + if (!WriteSymbolFile(binary, debug_dir, stdout)) { fprintf(stderr, "Failed to write symbol file.\n"); return 1; } diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc index 29ae3280571..9462376d76f 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc +++ b/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc @@ -31,40 +31,39 @@ // Large parts lifted from the userspace core dumper: // http://code.google.com/p/google-coredumper/ // -// Usage: minidump-2-core 1234.dmp > core - -#include - -#include -#include +// Usage: minidump-2-core [-v] 1234.dmp > core #include #include -#include #include -#include +#include +#include +#include +#include #include +#include +#include + +#include +#include +#include #include "google_breakpad/common/minidump_format.h" #include "google_breakpad/common/minidump_cpu_x86.h" +#include "client/linux/minidump_writer/minidump_extension_linux.h" #include "common/linux/linux_syscall_support.h" -#include "common/linux/minidump_format_linux.h" + #if __WORDSIZE == 64 #define ELF_CLASS ELFCLASS64 - #define Ehdr Elf64_Ehdr - #define Phdr Elf64_Phdr - #define Shdr Elf64_Shdr - #define Nhdr Elf64_Nhdr - #define auxv_t Elf64_auxv_t #else #define ELF_CLASS ELFCLASS32 - #define Ehdr Elf32_Ehdr - #define Phdr Elf32_Phdr - #define Shdr Elf32_Shdr - #define Nhdr Elf32_Nhdr - #define auxv_t Elf32_auxv_t #endif +#define Ehdr ElfW(Ehdr) +#define Phdr ElfW(Phdr) +#define Shdr ElfW(Shdr) +#define Nhdr ElfW(Nhdr) +#define auxv_t ElfW(auxv_t) #if defined(__x86_64__) @@ -77,8 +76,11 @@ #define ELF_ARCH EM_MIPS #endif +static const MDRVA kInvalidMDRVA = static_cast(-1); +static bool verbose; + static int usage(const char* argv0) { - fprintf(stderr, "Usage: %s \n", argv0); + fprintf(stderr, "Usage: %s [-v] \n", argv0); return 1; } @@ -113,7 +115,7 @@ class MMappedRange { // Get an object of |length| bytes at |offset| and return a pointer to it // unless it's out of bounds. - const void* GetObject(size_t offset, size_t length) { + const void* GetObject(size_t offset, size_t length) const { if (offset + length < offset) return NULL; if (offset + length > length_) @@ -123,11 +125,24 @@ class MMappedRange { // Get element |index| of an array of objects of length |length| starting at // |offset| bytes. Return NULL if out of bounds. - const void* GetArrayElement(size_t offset, size_t length, unsigned index) { + const void* GetArrayElement(size_t offset, size_t length, + unsigned index) const { const size_t element_offset = offset + index * length; return GetObject(element_offset, length); } + // Get a zero-terminated string. This method only works correctly for ASCII + // characters and does not convert between UTF-16 and UTF-8. + const std::string GetString(size_t offset) const { + const MDString* s = (const MDString*) GetObject(offset, sizeof(MDString)); + const u_int16_t* buf = &s->buffer[0]; + std::string str; + for (unsigned i = 0; i < s->length && buf[i]; ++i) { + str.push_back(buf[i]); + } + return str; + } + // Return a new range which is a subset of this range. MMappedRange Subrange(const MDLocationDescriptor& location) const { if (location.rva > length_ || @@ -204,7 +219,7 @@ typedef struct prpsinfo { /* Information about process */ char pr_psargs[80]; /* Initial part of arg list */ } prpsinfo; -// We parse the minidump file and keep the parsed information in this structure. +// We parse the minidump file and keep the parsed information in this structure struct CrashedProcess { CrashedProcess() : crashing_tid(-1), @@ -212,12 +227,23 @@ struct CrashedProcess { auxv_length(0) { memset(&prps, 0, sizeof(prps)); prps.pr_sname = 'R'; + memset(&debug, 0, sizeof(debug)); } struct Mapping { - uint64_t start_address, end_address; + Mapping() + : permissions(0xFFFFFFFF), + start_address(0), + end_address(0), + offset(0) { + } + + uint32_t permissions; + uint64_t start_address, end_address, offset; + std::string filename; + std::string data; }; - std::vector mappings; + std::map mappings; pid_t crashing_tid; int fatal_signal; @@ -226,7 +252,9 @@ struct CrashedProcess { pid_t tid; user_regs_struct regs; user_fpregs_struct fpregs; +#if defined(__i386__) user_fpxregs_struct fpxregs; +#endif uintptr_t stack_addr; const uint8_t* stack; size_t stack_length; @@ -237,8 +265,15 @@ struct CrashedProcess { size_t auxv_length; prpsinfo prps; + + std::map signatures; + + std::string dynamic_data; + MDRawDebug debug; + std::vector link_map; }; +#if defined(__i386__) static uint32_t U32(const uint8_t* data) { uint32_t v; @@ -253,7 +288,6 @@ U16(const uint8_t* data) { return v; } -#if defined(__i386__) static void ParseThreadRegisters(CrashedProcess::Thread* thread, MMappedRange range) { const MDRawContextX86* rawregs = @@ -299,6 +333,51 @@ ParseThreadRegisters(CrashedProcess::Thread* thread, MMappedRange range) { memcpy(thread->fpxregs.st_space, rawregs->extended_registers + 32, 128); memcpy(thread->fpxregs.xmm_space, rawregs->extended_registers + 160, 128); } +#elif defined(__x86_64__) +static void +ParseThreadRegisters(CrashedProcess::Thread* thread, MMappedRange range) { + const MDRawContextAMD64* rawregs = + (const MDRawContextAMD64*) range.GetObject(0, sizeof(MDRawContextAMD64)); + + thread->regs.r15 = rawregs->r15; + thread->regs.r14 = rawregs->r14; + thread->regs.r13 = rawregs->r13; + thread->regs.r12 = rawregs->r12; + thread->regs.rbp = rawregs->rbp; + thread->regs.rbx = rawregs->rbx; + thread->regs.r11 = rawregs->r11; + thread->regs.r10 = rawregs->r10; + thread->regs.r9 = rawregs->r9; + thread->regs.r8 = rawregs->r8; + thread->regs.rax = rawregs->rax; + thread->regs.rcx = rawregs->rcx; + thread->regs.rdx = rawregs->rdx; + thread->regs.rsi = rawregs->rsi; + thread->regs.rdi = rawregs->rdi; + thread->regs.orig_rax = rawregs->rax; + thread->regs.rip = rawregs->rip; + thread->regs.cs = rawregs->cs; + thread->regs.eflags = rawregs->eflags; + thread->regs.rsp = rawregs->rsp; + thread->regs.ss = rawregs->ss; + thread->regs.fs_base = 0; + thread->regs.gs_base = 0; + thread->regs.ds = rawregs->ds; + thread->regs.es = rawregs->es; + thread->regs.fs = rawregs->fs; + thread->regs.gs = rawregs->gs; + + thread->fpregs.cwd = rawregs->flt_save.control_word; + thread->fpregs.swd = rawregs->flt_save.status_word; + thread->fpregs.ftw = rawregs->flt_save.tag_word; + thread->fpregs.fop = rawregs->flt_save.error_opcode; + thread->fpregs.rip = rawregs->flt_save.error_offset; + thread->fpregs.rdp = rawregs->flt_save.data_offset; + thread->fpregs.mxcsr = rawregs->flt_save.mx_csr; + thread->fpregs.mxcr_mask = rawregs->flt_save.mx_csr_mask; + memcpy(thread->fpregs.st_space, rawregs->flt_save.float_registers, 8 * 16); + memcpy(thread->fpregs.xmm_space, rawregs->flt_save.xmm_registers, 16 * 16); +} #else #error "This code has not been ported to your platform yet" #endif @@ -308,6 +387,13 @@ ParseThreadList(CrashedProcess* crashinfo, MMappedRange range, const MMappedRange& full_file) { const uint32_t num_threads = *(const uint32_t*) range.GetObject(0, sizeof(uint32_t)); + if (verbose) { + fprintf(stderr, + "MD_THREAD_LIST_STREAM:\n" + "Found %d threads\n" + "\n\n", + num_threads); + } for (unsigned i = 0; i < num_threads; ++i) { CrashedProcess::Thread thread; memset(&thread, 0, sizeof(thread)); @@ -327,43 +413,304 @@ ParseThreadList(CrashedProcess* crashinfo, MMappedRange range, } } +static void +ParseSystemInfo(CrashedProcess* crashinfo, MMappedRange range, + const MMappedRange &full_file) { + const MDRawSystemInfo* sysinfo = + (MDRawSystemInfo*) range.GetObject(0, sizeof(MDRawSystemInfo)); + if (!sysinfo) { + fprintf(stderr, "Failed to access MD_SYSTEM_INFO_STREAM\n"); + _exit(1); + } +#if defined(__i386__) + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_X86) { + fprintf(stderr, + "This version of minidump-2-core only supports x86 (32bit)%s.\n", + sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64 ? + ",\nbut the minidump file is from a 64bit machine" : ""); + _exit(1); + } +#elif defined(__x86_64__) + if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_AMD64) { + fprintf(stderr, + "This version of minidump-2-core only supports x86 (64bit)%s.\n", + sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 ? + ",\nbut the minidump file is from a 32bit machine" : ""); + _exit(1); + } +#else +#error "This code has not been ported to your platform yet" +#endif + if (!strstr(full_file.GetString(sysinfo->csd_version_rva).c_str(), "Linux")){ + fprintf(stderr, "This minidump was not generated by Linux.\n"); + _exit(1); + } + + if (verbose) { + fprintf(stderr, + "MD_SYSTEM_INFO_STREAM:\n" + "Architecture: %s\n" + "Number of processors: %d\n" + "Processor level: %d\n" + "Processor model: %d\n" + "Processor stepping: %d\n", + sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 + ? "i386" + : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64 + ? "x86-64" + : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_ARM + ? "ARM" + : "???", + sysinfo->number_of_processors, + sysinfo->processor_level, + sysinfo->processor_revision >> 8, + sysinfo->processor_revision & 0xFF); + if (sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 || + 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, + 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] + : sizeof(sysinfo->cpu.x86_cpu_info.vendor_id), 1, stderr); + fputs("\n", stderr); + } + fprintf(stderr, "OS: %s\n", + full_file.GetString(sysinfo->csd_version_rva).c_str()); + fputs("\n\n", stderr); + } +} + +static void +ParseCPUInfo(CrashedProcess* crashinfo, MMappedRange range) { + if (verbose) { + fputs("MD_LINUX_CPU_INFO:\n", stderr); + fwrite(range.data(), range.length(), 1, stderr); + fputs("\n\n\n", stderr); + } +} + +static void +ParseProcessStatus(CrashedProcess* crashinfo, MMappedRange range) { + if (verbose) { + fputs("MD_LINUX_PROC_STATUS:\n", stderr); + fwrite(range.data(), range.length(), 1, stderr); + fputs("\n\n", stderr); + } +} + +static void +ParseLSBRelease(CrashedProcess* crashinfo, MMappedRange range) { + if (verbose) { + fputs("MD_LINUX_LSB_RELEASE:\n", stderr); + fwrite(range.data(), range.length(), 1, stderr); + fputs("\n\n", stderr); + } +} + +static void +ParseMaps(CrashedProcess* crashinfo, MMappedRange range) { + if (verbose) { + fputs("MD_LINUX_MAPS:\n", stderr); + fwrite(range.data(), range.length(), 1, stderr); + } + for (const u_int8_t* ptr = range.data(); + ptr < range.data() + range.length();) { + const u_int8_t* eol = (u_int8_t*)memchr(ptr, '\n', + range.data() + range.length() - ptr); + std::string line((const char*)ptr, + eol ? eol - ptr : range.data() + range.length() - ptr); + ptr = eol ? eol + 1 : range.data() + range.length(); + unsigned long long start, stop, offset; + char* permissions = NULL; + char* filename = NULL; + sscanf(line.c_str(), "%llx-%llx %m[-rwxp] %llx %*[:0-9a-f] %*d %ms", + &start, &stop, &permissions, &offset, &filename); + if (filename && *filename == '/') { + CrashedProcess::Mapping mapping; + mapping.permissions = 0; + if (strchr(permissions, 'r')) { + mapping.permissions |= PF_R; + } + if (strchr(permissions, 'w')) { + mapping.permissions |= PF_W; + } + if (strchr(permissions, 'x')) { + mapping.permissions |= PF_X; + } + mapping.start_address = start; + mapping.end_address = stop; + mapping.offset = offset; + if (filename) { + mapping.filename = filename; + } + crashinfo->mappings[mapping.start_address] = mapping; + } + free(permissions); + free(filename); + } + if (verbose) { + fputs("\n\n\n", stderr); + } +} + +static void +ParseEnvironment(CrashedProcess* crashinfo, MMappedRange range) { + if (verbose) { + fputs("MD_LINUX_ENVIRON:\n", stderr); + char *env = new char[range.length()]; + memcpy(env, range.data(), range.length()); + int nul_count = 0; + for (char *ptr = env;;) { + ptr = (char *)memchr(ptr, '\000', range.length() - (ptr - env)); + if (!ptr) { + break; + } + if (ptr > env && ptr[-1] == '\n') { + if (++nul_count > 5) { + // Some versions of Chrome try to rewrite the process' command line + // in a way that causes the environment to be corrupted. Afterwards, + // part of the environment will contain the trailing bit of the + // command line. The rest of the environment will be filled with + // NUL bytes. + // We detect this corruption by counting the number of consecutive + // NUL bytes. Normally, we would not expect any consecutive NUL + // bytes. But we are conservative and only suppress printing of + // the environment if we see at least five consecutive NULs. + fputs("Environment has been corrupted; no data available", stderr); + goto env_corrupted; + } + } else { + nul_count = 0; + } + *ptr = '\n'; + } + fwrite(env, range.length(), 1, stderr); + env_corrupted: + delete[] env; + fputs("\n\n\n", stderr); + } +} + static void ParseAuxVector(CrashedProcess* crashinfo, MMappedRange range) { + // Some versions of Chrome erroneously used the MD_LINUX_AUXV stream value + // when dumping /proc/$x/maps + if (range.length() > 17) { + // The AUXV vector contains binary data, whereas the maps always begin + // with an 8+ digit hex address followed by a hyphen and another 8+ digit + // address. + char addresses[18]; + memcpy(addresses, range.data(), 17); + addresses[17] = '\000'; + if (strspn(addresses, "0123456789abcdef-") == 17) { + ParseMaps(crashinfo, range); + return; + } + } + crashinfo->auxv = range.data(); crashinfo->auxv_length = range.length(); } static void ParseCmdLine(CrashedProcess* crashinfo, MMappedRange range) { + // The command line is supposed to use NUL bytes to separate arguments. + // As Chrome rewrites its own command line and (incorrectly) substitutes + // spaces, this is often not the case in our minidump files. const char* cmdline = (const char*) range.data(); + if (verbose) { + fputs("MD_LINUX_CMD_LINE:\n", stderr); + unsigned i = 0; + for (; i < range.length() && cmdline[i] && cmdline[i] != ' '; ++i) { } + fputs("argv[0] = \"", stderr); + fwrite(cmdline, i, 1, stderr); + fputs("\"\n", stderr); + for (unsigned j = ++i, argc = 1; j < range.length(); ++j) { + if (!cmdline[j] || cmdline[j] == ' ') { + fprintf(stderr, "argv[%d] = \"", argc++); + fwrite(cmdline + i, j - i, 1, stderr); + fputs("\"\n", stderr); + i = j + 1; + } + } + fputs("\n\n", stderr); + } + + const char *binary_name = cmdline; for (size_t i = 0; i < range.length(); ++i) { - if (cmdline[i] == 0) { + if (cmdline[i] == '/') { + binary_name = cmdline + i + 1; + } else if (cmdline[i] == 0 || cmdline[i] == ' ') { static const size_t fname_len = sizeof(crashinfo->prps.pr_fname) - 1; static const size_t args_len = sizeof(crashinfo->prps.pr_psargs) - 1; memset(crashinfo->prps.pr_fname, 0, fname_len + 1); memset(crashinfo->prps.pr_psargs, 0, args_len + 1); - const char* binary_name = strrchr(cmdline, '/'); - if (binary_name) { - binary_name++; - const unsigned len = strlen(binary_name); - memcpy(crashinfo->prps.pr_fname, binary_name, + unsigned len = cmdline + i - binary_name; + memcpy(crashinfo->prps.pr_fname, binary_name, len > fname_len ? fname_len : len); - } else { - memcpy(crashinfo->prps.pr_fname, cmdline, - i > fname_len ? fname_len : i); - } - const unsigned len = range.length() > args_len ? - args_len : range.length(); + len = range.length() > args_len ? args_len : range.length(); memcpy(crashinfo->prps.pr_psargs, cmdline, len); for (unsigned i = 0; i < len; ++i) { if (crashinfo->prps.pr_psargs[i] == 0) crashinfo->prps.pr_psargs[i] = ' '; } + break; } } } +static void +ParseDSODebugInfo(CrashedProcess* crashinfo, MMappedRange range, + const MMappedRange &full_file) { + const MDRawDebug* debug = + (MDRawDebug*) range.GetObject(0, sizeof(MDRawDebug)); + if (!debug) { + return; + } + if (verbose) { + fprintf(stderr, + "MD_LINUX_DSO_DEBUG:\n" + "Version: %d\n" + "Number of DSOs: %d\n" + "Brk handler: %p\n" + "Dynamic loader at: %p\n" + "_DYNAMIC: %p\n", + debug->version, + debug->dso_count, + debug->brk, + debug->ldbase, + debug->dynamic); + } + crashinfo->debug = *debug; + if (range.length() > sizeof(MDRawDebug)) { + char* dynamic_data = (char*)range.data() + sizeof(MDRawDebug); + crashinfo->dynamic_data.assign(dynamic_data, + range.length() - sizeof(MDRawDebug)); + } + if (debug->map != kInvalidMDRVA) { + for (int i = 0; i < debug->dso_count; ++i) { + const MDRawLinkMap* link_map = + (MDRawLinkMap*) full_file.GetArrayElement(debug->map, + sizeof(MDRawLinkMap), i); + if (link_map) { + if (verbose) { + fprintf(stderr, + "#%03d: %p, %p, \"%s\"\n", + i, link_map->addr, link_map->ld, + full_file.GetString(link_map->name).c_str()); + } + crashinfo->link_map.push_back(*link_map); + } + } + } + if (verbose) { + fputs("\n\n", stderr); + } +} + static void ParseExceptionStream(CrashedProcess* crashinfo, MMappedRange range) { const MDRawExceptionStream* exp = @@ -401,6 +748,7 @@ WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) { return false; } +#if defined(__i386__) nhdr.n_descsz = sizeof(user_fpxregs_struct); nhdr.n_type = NT_PRXFPREG; if (!writea(1, &nhdr, sizeof(nhdr)) || @@ -408,12 +756,17 @@ WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) { !writea(1, &thread.fpxregs, sizeof(user_fpxregs_struct))) { return false; } +#endif return true; } static void -ParseModuleStream(CrashedProcess* crashinfo, MMappedRange range) { +ParseModuleStream(CrashedProcess* crashinfo, MMappedRange range, + const MMappedRange &full_file) { + if (verbose) { + fputs("MD_MODULE_LIST_STREAM:\n", stderr); + } const uint32_t num_mappings = *(const uint32_t*) range.GetObject(0, sizeof(uint32_t)); for (unsigned i = 0; i < num_mappings; ++i) { @@ -424,16 +777,199 @@ ParseModuleStream(CrashedProcess* crashinfo, MMappedRange range) { mapping.start_address = rawmodule->base_of_image; mapping.end_address = rawmodule->size_of_image + rawmodule->base_of_image; - crashinfo->mappings.push_back(mapping); + if (crashinfo->mappings.find(mapping.start_address) == + crashinfo->mappings.end()) { + // We prefer data from MD_LINUX_MAPS over MD_MODULE_LIST_STREAM, as + // the former is a strict superset of the latter. + crashinfo->mappings[mapping.start_address] = mapping; + } + + const MDCVInfoPDB70* record = + (const MDCVInfoPDB70*)full_file.GetObject(rawmodule->cv_record.rva, + MDCVInfoPDB70_minsize); + char guid[40]; + sprintf(guid, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", + record->signature.data1, record->signature.data2, + record->signature.data3, + record->signature.data4[0], record->signature.data4[1], + record->signature.data4[2], record->signature.data4[3], + record->signature.data4[4], record->signature.data4[5], + record->signature.data4[6], record->signature.data4[7]); + std::string filename = full_file.GetString(rawmodule->module_name_rva); + size_t slash = filename.find_last_of('/'); + std::string basename = slash == std::string::npos ? + filename : filename.substr(slash + 1); + if (strcmp(guid, "00000000-0000-0000-0000-000000000000")) { + crashinfo->signatures[rawmodule->base_of_image] = + std::string("/var/lib/breakpad/") + guid + "-" + basename; + } + + if (verbose) { + fprintf(stderr, "0x%08llX-0x%08llX, ChkSum: 0x%08X, GUID: %s, \"%s\"\n", + (unsigned long long)rawmodule->base_of_image, + (unsigned long long)rawmodule->base_of_image + + rawmodule->size_of_image, + rawmodule->checksum, guid, filename.c_str()); + } + } + if (verbose) { + fputs("\n\n", stderr); + } +} + +static void +AddDataToMapping(CrashedProcess* crashinfo, const std::string& data, + uintptr_t addr) { + for (std::map::iterator + iter = crashinfo->mappings.begin(); + iter != crashinfo->mappings.end(); + ++iter) { + if (addr >= iter->second.start_address && + addr < iter->second.end_address) { + CrashedProcess::Mapping mapping = iter->second; + if ((addr & ~4095) != iter->second.start_address) { + // If there are memory pages in the mapping prior to where the + // data starts, truncate the existing mapping so that it ends with + // the page immediately preceding the data region. + iter->second.end_address = addr & ~4095; + if (!mapping.filename.empty()) { + // "mapping" is a copy of "iter->second". We are splitting the + // existing mapping into two separate ones when we write the data + // to the core file. The first one does not have any associated + // data in the core file, the second one is backed by data that is + // included with the core file. + // If this mapping wasn't supposed to be anonymous, then we also + // have to update the file offset upon splitting the mapping. + mapping.offset += iter->second.end_address - + iter->second.start_address; + } + } + // Create a new mapping that contains the data contents. We often + // limit the amount of data that is actually written to the core + // file. But it is OK if the mapping itself extends past the end of + // the data. + mapping.start_address = addr & ~4095; + mapping.data.assign(addr & 4095, 0).append(data); + mapping.data.append(-mapping.data.size() & 4095, 0); + crashinfo->mappings[mapping.start_address] = mapping; + return; + } + } + // Didn't find a suitable existing mapping for the data. Create a new one. + CrashedProcess::Mapping mapping; + mapping.permissions = PF_R | PF_W; + mapping.start_address = addr & ~4095; + mapping.end_address = + (addr + data.size() + 4095) & ~4095; + mapping.data.assign(addr & 4095, 0).append(data); + mapping.data.append(-mapping.data.size() & 4095, 0); + crashinfo->mappings[mapping.start_address] = mapping; +} + +static void +AugmentMappings(CrashedProcess* crashinfo, + const MMappedRange &full_file) { + // For each thread, find the memory mapping that matches the thread's stack. + // Then adjust the mapping to include the stack dump. + for (unsigned i = 0; i < crashinfo->threads.size(); ++i) { + const CrashedProcess::Thread& thread = crashinfo->threads[i]; + AddDataToMapping(crashinfo, + std::string((char *)thread.stack, thread.stack_length), + thread.stack_addr); + } + + // Create a new link map with information about DSOs. We move this map to + // the beginning of the address space, as this area should always be + // available. + static const uintptr_t start_addr = 4096; + std::string data; + struct r_debug debug = { 0 }; + debug.r_version = crashinfo->debug.version; + debug.r_brk = (ElfW(Addr))crashinfo->debug.brk; + debug.r_state = r_debug::RT_CONSISTENT; + debug.r_ldbase = (ElfW(Addr))crashinfo->debug.ldbase; + debug.r_map = crashinfo->debug.dso_count > 0 ? + (struct link_map*)(start_addr + sizeof(debug)) : 0; + data.append((char*)&debug, sizeof(debug)); + + struct link_map* prev = 0; + for (std::vector::iterator iter = crashinfo->link_map.begin(); + iter != crashinfo->link_map.end(); + ++iter) { + struct link_map link_map = { 0 }; + link_map.l_addr = (ElfW(Addr))iter->addr; + link_map.l_name = (char*)(start_addr + data.size() + sizeof(link_map)); + link_map.l_ld = (ElfW(Dyn)*)iter->ld; + link_map.l_prev = prev; + prev = (struct link_map*)(start_addr + data.size()); + std::string filename = full_file.GetString(iter->name); + + // Look up signature for this filename. If available, change filename + // to point to GUID, instead. + std::map::const_iterator guid = + crashinfo->signatures.find((uintptr_t)iter->addr); + if (guid != crashinfo->signatures.end()) { + filename = guid->second; + } + + if (std::distance(iter, crashinfo->link_map.end()) == 1) { + link_map.l_next = 0; + } else { + link_map.l_next = (struct link_map*)(start_addr + data.size() + + sizeof(link_map) + + ((filename.size() + 8) & ~7)); + } + data.append((char*)&link_map, sizeof(link_map)); + data.append(filename); + data.append(8 - (filename.size() & 7), 0); + } + AddDataToMapping(crashinfo, data, start_addr); + + // Map the page containing the _DYNAMIC array + if (!crashinfo->dynamic_data.empty()) { + // Make _DYNAMIC DT_DEBUG entry point to our link map + for (int i = 0;; ++i) { + ElfW(Dyn) dyn; + if ((i+1)*sizeof(dyn) > crashinfo->dynamic_data.length()) { + no_dt_debug: + if (verbose) { + fprintf(stderr, "No DT_DEBUG entry found\n"); + } + return; + } + memcpy(&dyn, crashinfo->dynamic_data.c_str() + i*sizeof(dyn), + sizeof(dyn)); + if (dyn.d_tag == DT_DEBUG) { + crashinfo->dynamic_data.replace(i*sizeof(dyn) + + offsetof(ElfW(Dyn), d_un.d_ptr), + sizeof(start_addr), + (char*)&start_addr, sizeof(start_addr)); + break; + } else if (dyn.d_tag == DT_NULL) { + goto no_dt_debug; + } + } + AddDataToMapping(crashinfo, crashinfo->dynamic_data, + (uintptr_t)crashinfo->debug.dynamic); } } int main(int argc, char** argv) { - if (argc != 2) + int argi = 1; + while (argi < argc && argv[argi][0] == '-') { + if (!strcmp(argv[argi], "-v")) { + verbose = true; + } else { + return usage(argv[0]); + } + argi++; + } + + if (argc != argi + 1) return usage(argv[0]); - const int fd = open(argv[1], O_RDONLY); + const int fd = open(argv[argi], O_RDONLY); if (fd < 0) return usage(argv[0]); @@ -454,6 +990,27 @@ main(int argc, char** argv) { CrashedProcess crashinfo; + // Always check the system info first, as that allows us to tell whether + // this is a minidump file that is compatible with our converter. + bool ok = false; + for (unsigned i = 0; i < header->stream_count; ++i) { + const MDRawDirectory* dirent = + (const MDRawDirectory*) dump.GetArrayElement( + header->stream_directory_rva, sizeof(MDRawDirectory), i); + switch (dirent->stream_type) { + case MD_SYSTEM_INFO_STREAM: + ParseSystemInfo(&crashinfo, dump.Subrange(dirent->location), dump); + ok = true; + break; + default: + break; + } + } + if (!ok) { + fprintf(stderr, "Cannot determine input file format.\n"); + _exit(1); + } + for (unsigned i = 0; i < header->stream_count; ++i) { const MDRawDirectory* dirent = (const MDRawDirectory*) dump.GetArrayElement( @@ -462,22 +1019,44 @@ main(int argc, char** argv) { case MD_THREAD_LIST_STREAM: ParseThreadList(&crashinfo, dump.Subrange(dirent->location), dump); break; + case MD_LINUX_CPU_INFO: + ParseCPUInfo(&crashinfo, dump.Subrange(dirent->location)); + break; + case MD_LINUX_PROC_STATUS: + ParseProcessStatus(&crashinfo, dump.Subrange(dirent->location)); + break; + case MD_LINUX_LSB_RELEASE: + ParseLSBRelease(&crashinfo, dump.Subrange(dirent->location)); + break; + case MD_LINUX_ENVIRON: + ParseEnvironment(&crashinfo, dump.Subrange(dirent->location)); + break; + case MD_LINUX_MAPS: + ParseMaps(&crashinfo, dump.Subrange(dirent->location)); + break; case MD_LINUX_AUXV: ParseAuxVector(&crashinfo, dump.Subrange(dirent->location)); break; case MD_LINUX_CMD_LINE: ParseCmdLine(&crashinfo, dump.Subrange(dirent->location)); break; + case MD_LINUX_DSO_DEBUG: + ParseDSODebugInfo(&crashinfo, dump.Subrange(dirent->location), dump); + break; case MD_EXCEPTION_STREAM: ParseExceptionStream(&crashinfo, dump.Subrange(dirent->location)); break; case MD_MODULE_LIST_STREAM: - ParseModuleStream(&crashinfo, dump.Subrange(dirent->location)); + ParseModuleStream(&crashinfo, dump.Subrange(dirent->location), dump); + break; default: - fprintf(stderr, "Skipping %x\n", dirent->stream_type); + if (verbose) + fprintf(stderr, "Skipping %x\n", dirent->stream_type); } } + AugmentMappings(&crashinfo, dump); + // Write the ELF header. The file will look like: // ELF header // Phdr for the PT_NOTE @@ -499,21 +1078,23 @@ main(int argc, char** argv) { ehdr.e_phoff = sizeof(Ehdr); ehdr.e_ehsize = sizeof(Ehdr); ehdr.e_phentsize= sizeof(Phdr); - ehdr.e_phnum = 1 + crashinfo.threads.size() + crashinfo.mappings.size(); + ehdr.e_phnum = 1 + // PT_NOTE + crashinfo.mappings.size(); // memory mappings ehdr.e_shentsize= sizeof(Shdr); if (!writea(1, &ehdr, sizeof(Ehdr))) return 1; - size_t offset = sizeof(Ehdr) + - (1 + crashinfo.threads.size() + - crashinfo.mappings.size()) * sizeof(Phdr); + size_t offset = sizeof(Ehdr) + ehdr.e_phnum * sizeof(Phdr); size_t filesz = sizeof(Nhdr) + 8 + sizeof(prpsinfo) + // sizeof(Nhdr) + 8 + sizeof(user) + sizeof(Nhdr) + 8 + crashinfo.auxv_length + crashinfo.threads.size() * ( (sizeof(Nhdr) + 8 + sizeof(prstatus)) + - sizeof(Nhdr) + 8 + sizeof(user_fpregs_struct) + - sizeof(Nhdr) + 8 + sizeof(user_fpxregs_struct)); + sizeof(Nhdr) + 8 + sizeof(user_fpregs_struct) +#if defined(__i386__) + + sizeof(Nhdr) + 8 + sizeof(user_fpxregs_struct) +#endif + ); Phdr phdr; memset(&phdr, 0, sizeof(Phdr)); @@ -524,31 +1105,35 @@ main(int argc, char** argv) { return 1; phdr.p_type = PT_LOAD; - phdr.p_align = getpagesize(); + phdr.p_align = 4096; size_t note_align = phdr.p_align - ((offset+filesz) % phdr.p_align); if (note_align == phdr.p_align) note_align = 0; offset += note_align; - for (unsigned i = 0; i < crashinfo.threads.size(); ++i) { - const CrashedProcess::Thread& thread = crashinfo.threads[i]; - offset += filesz; - filesz = thread.stack_length; - phdr.p_offset = offset; - phdr.p_vaddr = thread.stack_addr; - phdr.p_filesz = phdr.p_memsz = filesz; - phdr.p_flags = PF_R | PF_W; - if (!writea(1, &phdr, sizeof(phdr))) - return 1; - } - - for (unsigned i = 0; i < crashinfo.mappings.size(); ++i) { - const CrashedProcess::Mapping& mapping = crashinfo.mappings[i]; - phdr.p_offset = 0; + for (std::map::const_iterator iter = + crashinfo.mappings.begin(); + iter != crashinfo.mappings.end(); ++iter) { + const CrashedProcess::Mapping& mapping = iter->second; + if (mapping.permissions == 0xFFFFFFFF) { + // This is a map that we found in MD_MODULE_LIST_STREAM (as opposed to + // MD_LINUX_MAPS). It lacks some of the information that we would like + // to include. + phdr.p_flags = PF_R; + } else { + phdr.p_flags = mapping.permissions; + } phdr.p_vaddr = mapping.start_address; - phdr.p_filesz = 0; - phdr.p_flags = PF_R; phdr.p_memsz = mapping.end_address - mapping.start_address; + if (mapping.data.size()) { + offset += filesz; + filesz = mapping.data.size(); + phdr.p_filesz = mapping.data.size(); + phdr.p_offset = offset; + } else { + phdr.p_filesz = 0; + phdr.p_offset = 0; + } if (!writea(1, &phdr, sizeof(phdr))) return 1; } @@ -591,10 +1176,14 @@ main(int argc, char** argv) { return 1; } - for (unsigned i = 0; i < crashinfo.threads.size(); ++i) { - const CrashedProcess::Thread& thread = crashinfo.threads[i]; - if (!writea(1, thread.stack, thread.stack_length)) - return 1; + for (std::map::const_iterator iter = + crashinfo.mappings.begin(); + iter != crashinfo.mappings.end(); ++iter) { + const CrashedProcess::Mapping& mapping = iter->second; + if (mapping.data.size()) { + if (!writea(1, mapping.data.c_str(), mapping.data.size())) + return 1; + } } munmap(const_cast(bytes), st.st_size); diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj index 5759ab4dde9..abf9565a8ea 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj @@ -3,24 +3,26 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ 557800400BE1F28500EC23E0 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */; }; - 557800410BE1F28500EC23E0 /* macho_utilities.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5578003F0BE1F28500EC23E0 /* macho_utilities.h */; }; + 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */; }; + 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */; }; + 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */; }; + 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */; }; + 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */; }; + 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */; }; + 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8411F0C6FB00FCF3E4 /* language.cc */; }; + 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8611F0C6FB00FCF3E4 /* module.cc */; }; + 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */; }; 8B40BDC00C0638E4009535AF /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B40BDBF0C0638E4009535AF /* logging.cc */; }; + 8B4BDBBD120131CA009C7060 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDBBC120131CA009C7060 /* libcrypto.dylib */; }; 8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* crash_report.mm */; settings = {ATTRIBUTES = (); }; }; 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; - 9B35FEE40B2675F9008DE8C7 /* code_module.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FEE20B2675F9008DE8C7 /* code_module.h */; }; - 9B35FEE50B2675F9008DE8C7 /* code_modules.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FEE30B2675F9008DE8C7 /* code_modules.h */; }; - 9B35FEE90B26761C008DE8C7 /* basic_code_module.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FEE60B26761C008DE8C7 /* basic_code_module.h */; }; 9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */; }; - 9B35FEEB0B26761C008DE8C7 /* basic_code_modules.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FEE80B26761C008DE8C7 /* basic_code_modules.h */; }; - 9B3904960B2E52D90059FABE /* basic_source_line_resolver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B3904940B2E52D90059FABE /* basic_source_line_resolver.h */; }; - 9B3904970B2E52D90059FABE /* source_line_resolver_interface.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */; }; 9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */; }; - 9B44619E0B66C66B00BBB817 /* system_info.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B44619D0B66C66B00BBB817 /* system_info.h */; }; 9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172A0B1B8B2400F8391B /* call_stack.cc */; }; 9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */; }; 9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF173F0B1B8B9A00F8391B /* minidump.cc */; }; @@ -28,21 +30,12 @@ 9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */; }; 9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17530B1B8BF900F8391B /* stackwalker.cc */; }; 9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF175B0B1B8C1B00F8391B /* process_state.cc */; }; - 9BDF176D0B1B8CB100F8391B /* on_demand_symbol_supplier.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */; }; 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */; }; 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */; }; - 9BDF1AB90B1BE70C00F8391B /* range_map.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF1A7B0B1BE30100F8391B /* range_map.h */; }; - 9BDF1ABA0B1BE70D00F8391B /* range_map-inl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */; }; - 9BDF1AFC0B1BEB6300F8391B /* address_map-inl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF1AFA0B1BEB6300F8391B /* address_map-inl.h */; }; - 9BDF1AFD0B1BEB6300F8391B /* address_map.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF1AFB0B1BEB6300F8391B /* address_map.h */; }; - 9BDF21A60B1E825400F8391B /* dump_syms.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BDF192D0B1BC15D00F8391B /* dump_syms.h */; }; 9BDF21A70B1E825400F8391B /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */; }; 9BE650B20B52FE3000611104 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AC0B52FE3000611104 /* file_id.cc */; }; - 9BE650B30B52FE3000611104 /* file_id.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BE650AD0B52FE3000611104 /* file_id.h */; }; 9BE650B40B52FE3000611104 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AE0B52FE3000611104 /* macho_id.cc */; }; - 9BE650B50B52FE3000611104 /* macho_id.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BE650AF0B52FE3000611104 /* macho_id.h */; }; 9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650B00B52FE3000611104 /* macho_walker.cc */; }; - 9BE650B70B52FE3000611104 /* macho_walker.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BE650B10B52FE3000611104 /* macho_walker.h */; }; D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */; }; D2A5DD631188658B00081F03 /* tokenize.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD621188658B00081F03 /* tokenize.cc */; }; F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE20E8ABCA600E953AD /* bytereader.cc */; }; @@ -51,45 +44,36 @@ F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */; }; FD6625CD0CF4D45C004AC844 /* stackwalker_amd64.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */; }; FD8EDEAE0CADDAD400A5EDF1 /* stackwalker_sparc.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */; }; - FD8EDEAF0CADDAD400A5EDF1 /* stackwalker_sparc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - 9BDF176D0B1B8CB100F8391B /* on_demand_symbol_supplier.h in CopyFiles */, - 9BDF1AB90B1BE70C00F8391B /* range_map.h in CopyFiles */, - 9BDF1ABA0B1BE70D00F8391B /* range_map-inl.h in CopyFiles */, - 9BDF1AFC0B1BEB6300F8391B /* address_map-inl.h in CopyFiles */, - 9BDF1AFD0B1BEB6300F8391B /* address_map.h in CopyFiles */, - 9BDF21A60B1E825400F8391B /* dump_syms.h in CopyFiles */, - 9B35FEE40B2675F9008DE8C7 /* code_module.h in CopyFiles */, - 9B35FEE50B2675F9008DE8C7 /* code_modules.h in CopyFiles */, - 9B35FEE90B26761C008DE8C7 /* basic_code_module.h in CopyFiles */, - 9B35FEEB0B26761C008DE8C7 /* basic_code_modules.h in CopyFiles */, - 9B3904960B2E52D90059FABE /* basic_source_line_resolver.h in CopyFiles */, - 9B3904970B2E52D90059FABE /* source_line_resolver_interface.h in CopyFiles */, - 9BE650B30B52FE3000611104 /* file_id.h in CopyFiles */, - 9BE650B50B52FE3000611104 /* macho_id.h in CopyFiles */, - 9BE650B70B52FE3000611104 /* macho_walker.h in CopyFiles */, - 9B44619E0B66C66B00BBB817 /* system_info.h in CopyFiles */, - 557800410BE1F28500EC23E0 /* macho_utilities.h in CopyFiles */, - FD8EDEAF0CADDAD400A5EDF1 /* stackwalker_sparc.h in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 08FB7796FE84155DC02AAC07 /* crash_report.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = crash_report.mm; sourceTree = ""; }; - 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; }; 5578003F0BE1F28500EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; }; + 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cfi_to_module.cc; path = ../../../common/dwarf_cfi_to_module.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cfi_to_module.h; path = ../../../common/dwarf_cfi_to_module.h; sourceTree = SOURCE_ROOT; }; + 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cu_to_module.cc; path = ../../../common/dwarf_cu_to_module.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cu_to_module.h; path = ../../../common/dwarf_cu_to_module.h; sourceTree = SOURCE_ROOT; }; + 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_line_to_module.cc; path = ../../../common/dwarf_line_to_module.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_line_to_module.h; path = ../../../common/dwarf_line_to_module.h; sourceTree = SOURCE_ROOT; }; + 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_reader.cc; path = ../../../common/stabs_reader.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_reader.h; path = ../../../common/stabs_reader.h; sourceTree = SOURCE_ROOT; }; + 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_to_module.cc; path = ../../../common/stabs_to_module.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_to_module.h; path = ../../../common/stabs_to_module.h; sourceTree = SOURCE_ROOT; }; + 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader.cc; path = ../../../common/mac/macho_reader.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_reader.h; path = ../../../common/mac/macho_reader.h; sourceTree = SOURCE_ROOT; }; + 8B31FF8411F0C6FB00FCF3E4 /* language.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = language.cc; path = ../../../common/language.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF8511F0C6FB00FCF3E4 /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = language.h; path = ../../../common/language.h; sourceTree = SOURCE_ROOT; }; + 8B31FF8611F0C6FB00FCF3E4 /* module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cc; path = ../../../common/module.cc; sourceTree = SOURCE_ROOT; }; + 8B31FF8711F0C6FB00FCF3E4 /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../../common/module.h; sourceTree = SOURCE_ROOT; }; + 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2diehandler.cc; path = ../../../common/dwarf/dwarf2diehandler.cc; sourceTree = SOURCE_ROOT; }; + 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2diehandler.h; path = ../../../common/dwarf/dwarf2diehandler.h; sourceTree = SOURCE_ROOT; }; 8B40BDBF0C0638E4009535AF /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = ../../../processor/logging.cc; sourceTree = SOURCE_ROOT; }; + 8B4BDBBC120131CA009C7060 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; 8DD76FA10486AA7600D96B5E /* crash_report */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = crash_report; sourceTree = BUILT_PRODUCTS_DIR; }; 9B35FEE20B2675F9008DE8C7 /* code_module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_module.h; path = ../../../google_breakpad/processor/code_module.h; sourceTree = SOURCE_ROOT; }; 9B35FEE30B2675F9008DE8C7 /* code_modules.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_modules.h; path = ../../../google_breakpad/processor/code_modules.h; sourceTree = SOURCE_ROOT; }; @@ -152,6 +136,7 @@ buildActionMask = 2147483647; files = ( 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */, + 8B4BDBBD120131CA009C7060 /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -161,14 +146,33 @@ 08FB7794FE84155DC02AAC07 /* crash_report */ = { isa = PBXGroup; children = ( + 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */, + 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */, + 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */, F9C7ECE10E8ABC7F00E953AD /* DWARF */, 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */, 5578003F0BE1F28500EC23E0 /* macho_utilities.h */, + 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */, + 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */, 9BDF192D0B1BC15D00F8391B /* dump_syms.h */, 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */, 08FB7796FE84155DC02AAC07 /* crash_report.mm */, 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */, 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */, + 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */, + 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */, + 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */, + 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */, + 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */, + 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */, + 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */, + 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */, + 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */, + 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */, + 8B31FF8411F0C6FB00FCF3E4 /* language.cc */, + 8B31FF8511F0C6FB00FCF3E4 /* language.h */, + 8B31FF8611F0C6FB00FCF3E4 /* module.cc */, + 8B31FF8711F0C6FB00FCF3E4 /* module.h */, 08FB7795FE84155DC02AAC07 /* breakpad */, 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, 1AB674ADFE9D54B511CA2CBB /* Products */, @@ -189,6 +193,7 @@ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( + 8B4BDBBC120131CA009C7060 /* libcrypto.dylib */, 08FB779EFE84155DC02AAC07 /* Foundation.framework */, ); name = "External Frameworks and Libraries"; @@ -292,6 +297,8 @@ children = ( F9C7ECE20E8ABCA600E953AD /* bytereader.cc */, F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */, + 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */, + 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */, F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */, ); name = DWARF; @@ -306,7 +313,6 @@ buildPhases = ( 8DD76F990486AA7600D96B5E /* Sources */, 8DD76F9B0486AA7600D96B5E /* Frameworks */, - 8DD76F9E0486AA7600D96B5E /* CopyFiles */, ); buildRules = ( ); @@ -324,7 +330,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* crash_report */; projectDirPath = ""; @@ -366,6 +372,15 @@ F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */, D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */, D2A5DD631188658B00081F03 /* tokenize.cc in Sources */, + 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */, + 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */, + 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */, + 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */, + 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */, + 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */, + 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */, + 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */, + 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -375,65 +390,32 @@ 1DEB927508733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - _GLIBCXX_DEBUG_PEDANTIC, - _GLIBCXX_DEBUG, - _GLIBCPP_CONCEPT_CHECKS, - ); - INSTALL_PATH = "$(HOME)/bin"; - OTHER_LDFLAGS = "-lcrypto"; + HEADER_SEARCH_PATHS = ../../../../src; PRODUCT_NAME = crash_report; - USER_HEADER_SEARCH_PATHS = "../../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Debug; }; 1DEB927608733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - INSTALL_PATH = "$(HOME)/bin"; - OTHER_LDFLAGS = "-lcrypto"; + HEADER_SEARCH_PATHS = ../../../../src; PRODUCT_NAME = crash_report; - USER_HEADER_SEARCH_PATHS = "../../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Release; }; 1DEB927908733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; }; name = Debug; }; 1DEB927A08733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; }; name = Release; }; diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm index 4123a27c82e..4cc64f6aedf 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm @@ -53,7 +53,7 @@ OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir, const string &symbol_search_dir) : search_dir_(search_dir) { NSFileManager *mgr = [NSFileManager defaultManager]; - int length = symbol_search_dir.length(); + size_t length = symbol_search_dir.length(); if (length) { // Load all sym files in symbol_search_dir into our module_file_map // A symbol file always starts with a line like this: @@ -87,6 +87,7 @@ OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir, 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; @@ -149,7 +150,7 @@ OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module, if (s == FOUND) { - ifstream in(symbol_file->c_str()); + std::ifstream in(symbol_file->c_str()); getline(in, *symbol_data, std::string::traits_type::to_char_type( std::string::traits_type::eof())); in.close(); @@ -174,14 +175,14 @@ string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) { // search string and stop if a file (not dir) is found or all components // have been appended NSArray *pathComponents = [modulePath componentsSeparatedByString:@"/"]; - int count = [pathComponents count]; + size_t count = [pathComponents count]; NSMutableString *path = [NSMutableString string]; - for (int i = 0; i < count; ++i) { + for (size_t i = 0; i < count; ++i) { [path setString:searchDir]; - for (int j = 0; j < i + 1; ++j) { - int idx = count - 1 - i + j; + for (size_t j = 0; j < i + 1; ++j) { + size_t idx = count - 1 - i + j; [path appendFormat:@"/%@", [pathComponents objectAtIndex:idx]]; } @@ -214,7 +215,7 @@ static float GetFileModificationTime(const char *path) { struct stat file_stat; if (stat(path, &file_stat) == 0) result = (float)file_stat.st_mtimespec.tv_sec + - (float)file_stat.st_mtimespec.tv_nsec / 1.0e9; + (float)file_stat.st_mtimespec.tv_nsec / 1.0e9f; return result; } @@ -236,7 +237,7 @@ bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module, if ([[NSFileManager defaultManager] fileExistsAtPath:symbol_path]) { // Check if the module file is newer than the saved symbols float cache_time = - GetFileModificationTime([symbol_path fileSystemRepresentation]); + GetFileModificationTime([symbol_path fileSystemRepresentation]); float module_time = GetFileModificationTime(module_path.c_str()); @@ -248,15 +249,26 @@ bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module, NSString *module_str = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:module_path.c_str() length:module_path.length()]; - DumpSymbols *dump = [[DumpSymbols alloc] initWithContentsOfFile:module_str]; - const char *archStr = system_info->cpu.c_str(); - if ([dump setArchitecture:[NSString stringWithUTF8String:archStr]]) { - [dump writeSymbolFile:symbol_path]; + DumpSymbols dump; + if (dump.Read(module_str)) { + if (dump.SetArchitecture(system_info->cpu)) { + FILE *file = fopen([symbol_path fileSystemRepresentation],"w"); + if (file) { + dump.WriteSymbolFile(file); + fclose(file); + } else { + printf("Unable to open %s (%d)\n", name.c_str(), errno); + result = false; + } + } else { + printf("Architecture %s not available for %s\n", + system_info->cpu.c_str(), name.c_str()); + result = false; + } } else { - printf("Architecture %s not available for %s\n", archStr, name.c_str()); + printf("Unable to open %s\n", [module_str UTF8String]); result = false; } - [dump release]; } // Add the mapping diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj index 172b1fd3ac6..2ddaf2c7d8f 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXAggregateTarget section */ @@ -25,6 +25,7 @@ B88FB15D116CF54B00407530 /* PBXTargetDependency */, B84A9201116CF7D2006C210E /* PBXTargetDependency */, B88FB0C8116CEB4A00407530 /* PBXTargetDependency */, + 8B31051511F100CF00FCF3E4 /* PBXTargetDependency */, ); name = all_unittests; productName = all_unittests; @@ -32,6 +33,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 8B4BDBCA12013288009C7060 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B4BDBC912013288009C7060 /* libcrypto.dylib */; }; B84A91F8116CF78F006C210E /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; }; B84A91FB116CF7AF006C210E /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; }; B84A91FC116CF7AF006C210E /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3C11666C8900407530 /* stabs_to_module.cc */; }; @@ -83,7 +85,6 @@ B88FB13F116CF38300407530 /* bytereader_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0DA116CEC5800407530 /* bytereader_unittest.cc */; }; B88FB14F116CF4AE00407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; }; B88FB152116CF4D300407530 /* byte_cursor_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D4116CEC0600407530 /* byte_cursor_unittest.cc */; }; - B89E0E601166556C00DD08C9 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B89E0E5F1166556C00DD08C9 /* libcrypto.dylib */; }; B89E0E781166576C00DD08C9 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6E1166571D00DD08C9 /* macho_reader.cc */; }; B89E0E7A1166576C00DD08C9 /* macho_dump.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E701166573700DD08C9 /* macho_dump.cc */; }; B89E0E9911665A7200DD08C9 /* macho_reader_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6D1166571D00DD08C9 /* macho_reader_unittest.cc */; }; @@ -103,6 +104,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 8B31051411F100CF00FCF3E4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D21F97D111CBA0F200239E38; + remoteInfo = test_assembler_unittest; + }; B84A91F9116CF796006C210E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -261,9 +269,13 @@ /* Begin PBXFileReference section */ 08FB7796FE84155DC02AAC07 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = ""; }; - 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 557800890BE1F3AB00EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; }; 5578008A0BE1F3AB00EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; }; + 8B31023E11F0CF1C00FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; }; + 8B4BDBC912013288009C7060 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; 9BDF186D0B1BB43700F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = ""; }; 9BDF186E0B1BB43700F8391B /* dump_syms_tool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dump_syms_tool.mm; sourceTree = ""; }; 9BE650410B52F6D800611104 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; }; @@ -315,7 +327,6 @@ B88FB11F116CF27F00407530 /* dwarf_cfi_to_module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf_cfi_to_module_unittest; sourceTree = BUILT_PRODUCTS_DIR; }; B88FB135116CF30F00407530 /* bytereader_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = bytereader_unittest; sourceTree = BUILT_PRODUCTS_DIR; }; B88FB14B116CF4A700407530 /* byte_cursor_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = byte_cursor_unittest; sourceTree = BUILT_PRODUCTS_DIR; }; - B89E0E5F1166556C00DD08C9 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = ""; }; B89E0E6D1166571D00DD08C9 /* macho_reader_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader_unittest.cc; path = ../../../common/mac/macho_reader_unittest.cc; sourceTree = SOURCE_ROOT; }; B89E0E6E1166571D00DD08C9 /* macho_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader.cc; path = ../../../common/mac/macho_reader.cc; sourceTree = SOURCE_ROOT; }; B89E0E6F1166571D00DD08C9 /* macho_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_reader.h; path = ../../../common/mac/macho_reader.h; sourceTree = SOURCE_ROOT; }; @@ -445,7 +456,7 @@ buildActionMask = 2147483647; files = ( B8C5B523116653BA00D34F4E /* Foundation.framework in Frameworks */, - B89E0E601166556C00DD08C9 /* libcrypto.dylib in Frameworks */, + 8B4BDBCA12013288009C7060 /* libcrypto.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -463,6 +474,9 @@ 08FB7794FE84155DC02AAC07 /* dump_syms */ = { isa = PBXGroup; children = ( + 8B31023E11F0CF1C00FCF3E4 /* Breakpad.xcconfig */, + 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */, + 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */, B89E0E9D11665A9500DD08C9 /* TESTING */, F9F5344B0E7C8FFC0012363F /* DWARF */, B89E0E6C1166569700DD08C9 /* MACHO */, @@ -486,8 +500,8 @@ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( + 8B4BDBC912013288009C7060 /* libcrypto.dylib */, 08FB779EFE84155DC02AAC07 /* Foundation.framework */, - B89E0E5F1166556C00DD08C9 /* libcrypto.dylib */, ); name = "External Frameworks and Libraries"; sourceTree = ""; @@ -869,7 +883,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "dump_syms" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* dump_syms */; projectDirPath = ""; @@ -907,7 +921,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -eu\n\ncd $BUILT_PRODUCTS_DIR\npwd\n\n./byte_cursor_unittest\n./macho_reader_unittest\n./stabs_reader_unittest\n./bytereader_unittest\n./dwarf2reader_cfi_unittest\n./dwarf2diehandler_unittest\n./dwarf_cu_to_module_unittest\n./dwarf_line_to_module_unittest\n./dwarf_cfi_to_module_unittest\n./stabs_to_module_unittest\n./module_unittest\n\necho \"Expect two warnings from the following tests:\"\necho \" Errors.BadFileNumber\"\necho \" Errors.BadDirectoryNumber\"\necho \"The proper behavior of these tests is to print text that XCode confuses with compiler warnings.\"\n"; + shellScript = "set -eu\n\ncd $BUILT_PRODUCTS_DIR\npwd\n\n./byte_cursor_unittest\n./macho_reader_unittest\n./stabs_reader_unittest\n./bytereader_unittest\n./dwarf2reader_cfi_unittest\n./dwarf2diehandler_unittest\n./dwarf_cu_to_module_unittest\n./dwarf_line_to_module_unittest\n./dwarf_cfi_to_module_unittest\n./stabs_to_module_unittest\n./module_unittest\n./test_assembler_unittest\n\necho \"Expect two warnings from the following tests:\"\necho \" Errors.BadFileNumber\"\necho \" Errors.BadDirectoryNumber\"\necho \"The proper behavior of these tests is to print text that XCode confuses with compiler warnings.\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1074,6 +1088,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 8B31051511F100CF00FCF3E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D21F97D111CBA0F200239E38 /* test_assembler_unittest */; + targetProxy = 8B31051411F100CF00FCF3E4 /* PBXContainerItemProxy */; + }; B84A91FA116CF796006C210E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B88FB023116BDFFF00407530 /* gtestmockall */; @@ -1189,38 +1208,30 @@ /* Begin XCBuildConfiguration section */ 1DEB927908733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = "../../../**"; - ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)"; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + HEADER_SEARCH_PATHS = ../../..; }; name = Debug; }; 1DEB927A08733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + HEADER_SEARCH_PATHS = ../../..; }; name = Release; }; B84A91F6116CF784006C210E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = stabs_to_module_unittest; }; name = Debug; @@ -1228,38 +1239,32 @@ B84A91F7116CF784006C210E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = stabs_to_module_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FAF31116A591F00407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - INSTALL_PATH = /usr/local/bin; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug\""; - ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)"; - PREBINDING = NO; PRODUCT_NAME = dwarf2reader_cfi_unittest; }; name = Debug; @@ -1267,29 +1272,25 @@ B88FAF32116A591F00407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug\""; - PREBINDING = NO; PRODUCT_NAME = dwarf2reader_cfi_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FAFCA116BDCAD00407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = all_unittests; }; name = Debug; @@ -1297,26 +1298,21 @@ B88FAFCB116BDCAD00407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; PRODUCT_NAME = all_unittests; - ZERO_LINK = NO; }; name = Release; }; B88FB009116BDE8400407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = stabs_reader_unittest; }; name = Debug; @@ -1324,32 +1320,28 @@ B88FB00A116BDE8400407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = stabs_reader_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB025116BE00100407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - INSTALL_PATH = /usr/local/lib; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = gtestmockall; }; name = Debug; @@ -1357,29 +1349,27 @@ B88FB026116BE00100407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/lib; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = gtestmockall; - ZERO_LINK = NO; }; name = Release; }; B88FB0BB116CEAC000407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = module_unittest; }; name = Debug; @@ -1387,29 +1377,27 @@ B88FB0BC116CEAC000407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = module_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB0E1116CEEA800407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf2diehandler_unittest; }; name = Debug; @@ -1417,29 +1405,27 @@ B88FB0E2116CEEA800407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf2diehandler_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB0F4116CEF1900407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_line_to_module_unittest; }; name = Debug; @@ -1447,29 +1433,27 @@ B88FB0F5116CEF1900407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_line_to_module_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB10C116CF07A00407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_cu_to_module_unittest; }; name = Debug; @@ -1477,29 +1461,27 @@ B88FB10D116CF07A00407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_cu_to_module_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB121116CF28000407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_cfi_to_module_unittest; }; name = Debug; @@ -1507,29 +1489,27 @@ B88FB122116CF28000407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = dwarf_cfi_to_module_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB137116CF30F00407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = bytereader_unittest; }; name = Debug; @@ -1537,29 +1517,27 @@ B88FB138116CF30F00407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = bytereader_unittest; - ZERO_LINK = NO; }; name = Release; }; B88FB14D116CF4A800407530 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = byte_cursor_unittest; }; name = Debug; @@ -1567,29 +1545,20 @@ B88FB14E116CF4A800407530 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = byte_cursor_unittest; - ZERO_LINK = NO; }; name = Release; }; B89E0E761166575300DD08C9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; PRODUCT_NAME = macho_dump; }; name = Debug; @@ -1597,29 +1566,20 @@ B89E0E771166575300DD08C9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; PRODUCT_NAME = macho_dump; - ZERO_LINK = NO; }; name = Release; }; B89E0E9711665A6400DD08C9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = macho_reader_unittest; }; name = Debug; @@ -1627,31 +1587,21 @@ B89E0E9811665A6400DD08C9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, + ); PRODUCT_NAME = macho_reader_unittest; - ZERO_LINK = NO; }; name = Release; }; B8C5B5131166531B00D34F4E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ""; - PREBINDING = NO; PRODUCT_NAME = dump_syms; }; name = Debug; @@ -1659,39 +1609,21 @@ B8C5B5141166531B00D34F4E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; - INSTALL_PATH = /usr/local/bin; - PREBINDING = NO; PRODUCT_NAME = dump_syms; - ZERO_LINK = NO; }; name = Release; }; D21F97D411CBA0F200239E38 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, ); - PREBINDING = NO; - PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; PRODUCT_NAME = test_assembler_unittest; }; name = Debug; @@ -1699,23 +1631,14 @@ D21F97D511CBA0F200239E38 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, + HEADER_SEARCH_PATHS = ( + $inherited, + ../../../testing, + ../../../testing/include, + ../../../testing/gtest, + ../../../testing/gtest/include, ); - PREBINDING = NO; PRODUCT_NAME = test_assembler_unittest; - ZERO_LINK = NO; }; name = Release; }; diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc index fcef37c5e62..940df25bd2e 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc @@ -137,7 +137,8 @@ void DumpFile(const char *filename) { } printf("filename: %s\n", filename); size_t object_files_size; - struct fat_arch *object_files = fat_reader.object_files(&object_files_size); + const struct fat_arch *object_files + = fat_reader.object_files(&object_files_size); 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]; diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m index 4f9d8c7a335..991a5de5ebc 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m @@ -98,10 +98,10 @@ SetupOptions(int argc, const char *argv[], Options *options) { while ((ch = getopt(argc, (char * const *)argv, "p:v:h?")) != -1) { switch (ch) { case 'p': - options->product = [NSString stringWithCString:optarg]; + options->product = [NSString stringWithUTF8String:optarg]; break; case 'v': - options->version = [NSString stringWithCString:optarg]; + options->version = [NSString stringWithUTF8String:optarg]; break; default: @@ -117,8 +117,8 @@ SetupOptions(int argc, const char *argv[], Options *options) { exit(1); } - options->minidumpPath = [NSString stringWithCString:argv[optind]]; - options->uploadURLStr = [NSString stringWithCString:argv[optind + 1]]; + options->minidumpPath = [NSString stringWithUTF8String:argv[optind]]; + options->uploadURLStr = [NSString stringWithUTF8String:argv[optind + 1]]; } //============================================================================= diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m index 7830cdca061..fe0cb67cb44 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m @@ -134,7 +134,7 @@ static void Start(Options *options) { fprintf(stdout, "Send: %s\n", error ? [[error description] UTF8String] : "No Error"); fprintf(stdout, "Response: %d\n", status); - fprintf(stdout, "Result: %d bytes\n%s\n", [data length], [result UTF8String]); + fprintf(stdout, "Result: %lu bytes\n%s\n", [data length], [result UTF8String]); [result release]; [ul release]; @@ -173,8 +173,8 @@ SetupOptions(int argc, const char *argv[], Options *options) { exit(1); } - options->symbolsPath = [NSString stringWithCString:argv[optind]]; - options->uploadURLStr = [NSString stringWithCString:argv[optind + 1]]; + options->symbolsPath = [NSString stringWithUTF8String:argv[optind]]; + options->uploadURLStr = [NSString stringWithUTF8String:argv[optind + 1]]; } //============================================================================= diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj index d2f4a1cae3e..a6a78dc5f3e 100644 --- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj +++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj @@ -3,10 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ + 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 */; }; 9BC1D49E0B37427A00F2A2B4 /* minidump_upload.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD836000B0544BA0055103E /* minidump_upload.m */; }; @@ -30,7 +31,10 @@ /* Begin PBXFileReference section */ 08FB7796FE84155DC02AAC07 /* symupload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = symupload.m; sourceTree = ""; }; - 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 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 = ""; }; 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPMultipartUpload.m; path = ../../../common/mac/HTTPMultipartUpload.m; sourceTree = ""; }; @@ -51,6 +55,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8B31022C11F0CEBD00FCF3E4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,6 +65,9 @@ 08FB7794FE84155DC02AAC07 /* symupload */ = { isa = PBXGroup; children = ( + 8B31022B11F0CE6900FCF3E4 /* Breakpad.xcconfig */, + 8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */, + 8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */, 08FB7796FE84155DC02AAC07 /* symupload.m */, 9BD836000B0544BA0055103E /* minidump_upload.m */, 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */, @@ -130,9 +138,11 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "symupload" */; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* symupload */; projectDirPath = ""; + projectRoot = ""; targets = ( 8DD76F960486AA7600D96B5E /* symupload */, 9BD835FA0B0544950055103E /* minidump_upload */, @@ -165,105 +175,46 @@ 1DEB927508733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INSTALL_PATH = "$(HOME)/bin"; + HEADER_SEARCH_PATHS = ../../..; PRODUCT_NAME = symupload; - USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Debug; }; 1DEB927608733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_C_LANGUAGE_STANDARD = c99; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INSTALL_PATH = "$(HOME)/bin"; + HEADER_SEARCH_PATHS = ../../..; PRODUCT_NAME = symupload; - USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)"; - ZERO_LINK = NO; }; name = Release; }; 1DEB927908733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Debug; }; 1DEB927A08733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Release; }; 9BD836030B0544BB0055103E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = "$(HOME)/bin"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../../..; PRODUCT_NAME = minidump_upload; - USER_HEADER_SEARCH_PATHS = "../../../**"; - ZERO_LINK = NO; }; name = Debug; }; 9BD836040B0544BB0055103E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = "$(HOME)/bin"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; + HEADER_SEARCH_PATHS = ../../..; PRODUCT_NAME = minidump_upload; - USER_HEADER_SEARCH_PATHS = "../../../**"; - ZERO_LINK = NO; }; name = Release; };