OLD | NEW |
1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 #include <string> | 38 #include <string> |
39 | 39 |
40 #include "client/linux/crash_generation/crash_generation_client.h" | 40 #include "client/linux/crash_generation/crash_generation_client.h" |
41 #include "client/linux/handler/minidump_descriptor.h" | 41 #include "client/linux/handler/minidump_descriptor.h" |
42 #include "client/linux/minidump_writer/minidump_writer.h" | 42 #include "client/linux/minidump_writer/minidump_writer.h" |
43 #include "common/scoped_ptr.h" | 43 #include "common/scoped_ptr.h" |
44 #include "common/using_std_string.h" | 44 #include "common/using_std_string.h" |
45 #include "google_breakpad/common/minidump_format.h" | 45 #include "google_breakpad/common/minidump_format.h" |
46 | 46 |
| 47 #if !defined(__ARM_EABI__) && !defined(__mips__) && !defined(__SH4__) |
| 48 // FP state is not part of user ABI for Linux ARM. |
| 49 // In case of MIPS and SH4 Linux, FP state is already part of struct |
| 50 // ucontext so 'float_state' is not required. |
| 51 #define CONTEXT_FLOAT_STATE |
| 52 #endif |
| 53 |
47 namespace google_breakpad { | 54 namespace google_breakpad { |
48 | 55 |
49 // ExceptionHandler | 56 // ExceptionHandler |
50 // | 57 // |
51 // ExceptionHandler can write a minidump file when an exception occurs, | 58 // ExceptionHandler can write a minidump file when an exception occurs, |
52 // or when WriteMinidump() is called explicitly by your program. | 59 // or when WriteMinidump() is called explicitly by your program. |
53 // | 60 // |
54 // To have the exception handler write minidumps when an uncaught exception | 61 // To have the exception handler write minidumps when an uncaught exception |
55 // (crash) occurs, you should create an instance early in the execution | 62 // (crash) occurs, you should create an instance early in the execution |
56 // of your program, and keep it around for the entire time you want to | 63 // of your program, and keep it around for the entire time you want to |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const string& dump_path, | 192 const string& dump_path, |
186 MinidumpCallback callback, | 193 MinidumpCallback callback, |
187 void* callback_context); | 194 void* callback_context); |
188 | 195 |
189 // This structure is passed to minidump_writer.h:WriteMinidump via an opaque | 196 // This structure is passed to minidump_writer.h:WriteMinidump via an opaque |
190 // blob. It shouldn't be needed in any user code. | 197 // blob. It shouldn't be needed in any user code. |
191 struct CrashContext { | 198 struct CrashContext { |
192 siginfo_t siginfo; | 199 siginfo_t siginfo; |
193 pid_t tid; // the crashing thread. | 200 pid_t tid; // the crashing thread. |
194 struct ucontext context; | 201 struct ucontext context; |
195 #if !defined(__ARM_EABI__) && !defined(__mips__) | 202 #ifdef CONTEXT_FLOAT_STATE |
196 // #ifdef this out because FP state is not part of user ABI for Linux ARM. | |
197 // In case of MIPS Linux FP state is already part of struct | |
198 // ucontext so 'float_state' is not required. | |
199 fpstate_t float_state; | 203 fpstate_t float_state; |
200 #endif | 204 #endif |
201 }; | 205 }; |
202 | 206 |
203 // Returns whether out-of-process dump generation is used or not. | 207 // Returns whether out-of-process dump generation is used or not. |
204 bool IsOutOfProcess() const { | 208 bool IsOutOfProcess() const { |
205 return crash_generation_client_.get() != NULL; | 209 return crash_generation_client_.get() != NULL; |
206 } | 210 } |
207 | 211 |
208 // Add information about a memory mapping. This can be used if | 212 // Add information about a memory mapping. This can be used if |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 MappingList mapping_list_; | 273 MappingList mapping_list_; |
270 | 274 |
271 // Callers can request additional memory regions to be included in | 275 // Callers can request additional memory regions to be included in |
272 // the dump. | 276 // the dump. |
273 AppMemoryList app_memory_list_; | 277 AppMemoryList app_memory_list_; |
274 }; | 278 }; |
275 | 279 |
276 } // namespace google_breakpad | 280 } // namespace google_breakpad |
277 | 281 |
278 #endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ | 282 #endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ |
OLD | NEW |