aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump.cc
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-10-24 19:31:21 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-10-24 19:31:21 +0000
commite5468b8a49ac6a4e5acb9d4003838e3e323f85e4 (patch)
tree98797c8d85489571495708ce167681a4a00a1db9 /src/processor/minidump.cc
parentReplace auto_ptr with scoped_ptr (#56). r=bryner (diff)
downloadbreakpad-e5468b8a49ac6a4e5acb9d4003838e3e323f85e4.tar.xz
MinidumpProcessor should process all threads (#35). r=bryner
- MinidumpProcessor now processes all threads and returns a new ProcessState object. (Interface change.) - ProcessState contains a CallStack for each thread in the process, and additional information about whether the process crashed, which thread crashed, the reason for the crash, and identifying attributes for the OS and CPU. - MinidumpSystemInfo now contains a GetCPUVendor() method that returns the vendor information from CPUID 0 on x86 processors ("GenuineIntel"). http://groups.google.com/group/airbag-dev/browse_thread/thread/16dd2c981e3361ba git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@47 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump.cc')
-rw-r--r--src/processor/minidump.cc52
1 files changed, 47 insertions, 5 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index 068f47d0..c99c432e 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -1779,12 +1779,14 @@ void MinidumpException::Print() {
MinidumpSystemInfo::MinidumpSystemInfo(Minidump* minidump)
: MinidumpStream(minidump),
system_info_(),
- csd_version_(NULL) {
+ csd_version_(NULL),
+ cpu_vendor_(NULL) {
}
MinidumpSystemInfo::~MinidumpSystemInfo() {
delete csd_version_;
+ delete cpu_vendor_;
}
@@ -1792,6 +1794,8 @@ bool MinidumpSystemInfo::Read(u_int32_t expected_size) {
// Invalidate cached data.
delete csd_version_;
csd_version_ = NULL;
+ delete cpu_vendor_;
+ cpu_vendor_ = NULL;
valid_ = false;
@@ -1844,6 +1848,36 @@ const string* MinidumpSystemInfo::GetCSDVersion() {
}
+const string* MinidumpSystemInfo::GetCPUVendor() {
+ if (!valid_)
+ return NULL;
+
+ // CPU vendor information can only be determined from x86 minidumps.
+ if (!cpu_vendor_ &&
+ (system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86 ||
+ system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86_WIN64)) {
+ char cpu_vendor_string[13];
+ snprintf(cpu_vendor_string, sizeof(cpu_vendor_string),
+ "%c%c%c%c%c%c%c%c%c%c%c%c",
+ system_info_.cpu.x86_cpu_info.vendor_id[0] & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 8) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 16) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 24) & 0xff,
+ system_info_.cpu.x86_cpu_info.vendor_id[1] & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 8) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 16) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 24) & 0xff,
+ system_info_.cpu.x86_cpu_info.vendor_id[2] & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 8) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 16) & 0xff,
+ (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 24) & 0xff);
+ cpu_vendor_ = new string(cpu_vendor_string);
+ }
+
+ return cpu_vendor_;
+}
+
+
void MinidumpSystemInfo::Print() {
if (!valid_)
return;
@@ -1881,12 +1915,20 @@ void MinidumpSystemInfo::Print() {
system_info_.cpu.x86_cpu_info.feature_information);
printf(" cpu.x86_cpu_info.amd_extended_cpu_features = 0x%x\n",
system_info_.cpu.x86_cpu_info.amd_extended_cpu_features);
- const char* csd_version = GetCSDVersion()->c_str();
- if (csd_version)
+ const string* csd_version = GetCSDVersion();
+ if (csd_version) {
printf(" (csd_version) = \"%s\"\n",
- csd_version);
- else
+ csd_version->c_str());
+ } else {
printf(" (csd_version) = (null)\n");
+ }
+ const string* cpu_vendor = GetCPUVendor();
+ if (cpu_vendor) {
+ printf(" (cpu_vendor) = \"%s\"\n",
+ cpu_vendor->c_str());
+ } else {
+ printf(" (cpu_vendor) = (null)\n");
+ }
printf("\n");
}