diff options
author | dmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-19 20:43:49 +0000 |
---|---|---|
committer | dmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-19 20:43:49 +0000 |
commit | 4ac61acb3a7dad6ce722fe07564be8ec92713228 (patch) | |
tree | fb71c49eb2aa7ca1f1867854ad9871c84504bc46 /src/client/mac/handler/minidump_generator.cc | |
parent | Breakpad Linux/Mac symbol dumper: Share duplicate strings that arise in DWARF... (diff) | |
download | breakpad-4ac61acb3a7dad6ce722fe07564be8ec92713228.tar.xz |
Clean up build for 64 bit.
Fix up some broken mac projects.
Consolidate project settings in xcconfig files.
http://breakpad.appspot.com/130001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@627 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/handler/minidump_generator.cc')
-rw-r--r-- | src/client/mac/handler/minidump_generator.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index f6d0638c..ea0ec9ae 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/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 { @@ -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<u_int32_t>(machine_state->__rflags); AddReg(cs); AddReg(fs); AddReg(gs); @@ -727,7 +730,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<u_int32_t>(image->GetVMSize()); module->module_name_rva = string_location.rva; // We'll skip the executable module, because they don't have @@ -794,7 +797,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<u_int32_t>(seg->vmsize); module->module_name_rva = string_location.rva; if (!WriteCVRecord(module, cpu_type, name)) @@ -943,8 +946,10 @@ 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<u_int32_t>(usage.ru_utime.tv_sec); + info_ptr->process_kernel_time = + static_cast<u_int32_t>(usage.ru_stime.tv_sec); } int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, info_ptr->process_id }; size_t size; @@ -956,20 +961,22 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { 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; + info_ptr->process_create_time = + static_cast<u_int32_t>(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<u_int32_t>(speed / kOneMillion); + info_ptr->processor_mhz_limit = static_cast<u_int32_t>(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<u_int32_t>(speed / kOneMillion); return true; } |