Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: src/client/mac/handler/minidump_generator.cc

Issue 130001: Cleans up mac projects, and builds everything 64 bit (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Applied fixes based on Mark's review Created 14 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/client/mac/handler/minidump_generator.cc
===================================================================
--- src/client/mac/handler/minidump_generator.cc (revision 623)
+++ src/client/mac/handler/minidump_generator.cc (working copy)
@@ -57,7 +57,8 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
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 @@
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,7 +961,8 @@
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);
}
}
@@ -965,11 +971,11 @@
uint64_t speed;
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 / (1000000));
Mark Mentovai 2010/07/19 03:31:22 These three were marginally easier before when the
+ info_ptr->processor_mhz_limit = static_cast<u_int32_t>(speed / (1000000));
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 / (1000000));
return true;
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted