• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:
SystemInfoSystemInfo46   SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(),
47     cpu_count(0), gl_version(), gl_vendor(), gl_renderer() {}
48 
49   // Resets the SystemInfo object to its default values.
ClearSystemInfo50   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     gl_version.clear();
58     gl_vendor.clear();
59     gl_renderer.clear();
60   }
61 
62   // A string identifying the operating system, such as "Windows NT",
63   // "Mac OS X", or "Linux".  If the information is present in the dump but
64   // its value is unknown, this field will contain a numeric value.  If
65   // the information is not present in the dump, this field will be empty.
66   string os;
67 
68   // A short form of the os string, using lowercase letters and no spaces,
69   // suitable for use in a filesystem.  Possible values include "windows",
70   // "mac", "linux" and "nacl".  Empty if the information is not present
71   // in the dump or if the OS given by the dump is unknown.  The values
72   // stored in this field should match those used by
73   // MinidumpSystemInfo::GetOS.
74   string os_short;
75 
76   // A string identifying the version of the operating system, such as
77   // "5.1.2600 Service Pack 2" or "10.4.8 8L2127".  If the dump does not
78   // contain this information, this field will be empty.
79   string os_version;
80 
81   // A string identifying the basic CPU family, such as "x86" or "ppc".
82   // If this information is present in the dump but its value is unknown,
83   // this field will contain a numeric value.  If the information is not
84   // present in the dump, this field will be empty.  The values stored in
85   // this field should match those used by MinidumpSystemInfo::GetCPU.
86   string cpu;
87 
88   // A string further identifying the specific CPU, such as
89   // "GenuineIntel level 6 model 13 stepping 8".  If the information is not
90   // present in the dump, or additional identifying information is not
91   // defined for the CPU family, this field will be empty.
92   string cpu_info;
93 
94   // The number of processors in the system.  Will be greater than one for
95   // multi-core systems.
96   int cpu_count;
97 
98   // The GPU information. Currently only populated in microdumps.
99   string gl_version;
100   string gl_vendor;
101   string gl_renderer;
102 };
103 
104 }  // namespace google_breakpad
105 
106 #endif  // GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
107