Home | History | Annotate | Download | only in processor
      1 // Copyright (c) 2006, Google Inc.
      2 // All rights reserved.
      3 //
      4 // Redistribution and use in source and binary forms, with or without
      5 // modification, are permitted provided that the following conditions are
      6 // met:
      7 //
      8 //     * Redistributions of source code must retain the above copyright
      9 // notice, this list of conditions and the following disclaimer.
     10 //     * Redistributions in binary form must reproduce the above
     11 // copyright notice, this list of conditions and the following disclaimer
     12 // in the documentation and/or other materials provided with the
     13 // distribution.
     14 //     * Neither the name of Google Inc. nor the names of its
     15 // contributors may be used to endorse or promote products derived from
     16 // this software without specific prior written permission.
     17 //
     18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29 
     30 // system_info.h: Information about the system that was running a program
     31 // when a crash report was produced.
     32 //
     33 // Author: Mark Mentovai
     34 
     35 #ifndef GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
     36 #define GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
     37 
     38 #include <string>
     39 
     40 #include "common/using_std_string.h"
     41 
     42 namespace google_breakpad {
     43 
     44 struct SystemInfo {
     45  public:
     46   SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(),
     47     cpu_count(0) {}
     48 
     49   // Resets the SystemInfo object to its default values.
     50   void Clear() {
     51     os.clear();
     52     os_short.clear();
     53     os_version.clear();
     54     cpu.clear();
     55     cpu_info.clear();
     56     cpu_count = 0;
     57   }
     58 
     59   // A string identifying the operating system, such as "Windows NT",
     60   // "Mac OS X", or "Linux".  If the information is present in the dump but
     61   // its value is unknown, this field will contain a numeric value.  If
     62   // the information is not present in the dump, this field will be empty.
     63   string os;
     64 
     65   // A short form of the os string, using lowercase letters and no spaces,
     66   // suitable for use in a filesystem.  Possible values include "windows",
     67   // "mac", "linux" and "nacl".  Empty if the information is not present
     68   // in the dump or if the OS given by the dump is unknown.  The values
     69   // stored in this field should match those used by
     70   // MinidumpSystemInfo::GetOS.
     71   string os_short;
     72 
     73   // A string identifying the version of the operating system, such as
     74   // "5.1.2600 Service Pack 2" or "10.4.8 8L2127".  If the dump does not
     75   // contain this information, this field will be empty.
     76   string os_version;
     77 
     78   // A string identifying the basic CPU family, such as "x86" or "ppc".
     79   // If this information is present in the dump but its value is unknown,
     80   // this field will contain a numeric value.  If the information is not
     81   // present in the dump, this field will be empty.  The values stored in
     82   // this field should match those used by MinidumpSystemInfo::GetCPU.
     83   string cpu;
     84 
     85   // A string further identifying the specific CPU, such as
     86   // "GenuineIntel level 6 model 13 stepping 8".  If the information is not
     87   // present in the dump, or additional identifying information is not
     88   // defined for the CPU family, this field will be empty.
     89   string cpu_info;
     90 
     91   // The number of processors in the system.  Will be greater than one for
     92   // multi-core systems.
     93   int cpu_count;
     94 };
     95 
     96 }  // namespace google_breakpad
     97 
     98 #endif  // GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
     99