OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 //! \brief Returns the top-level exception code identifying the exception. | 47 //! \brief Returns the top-level exception code identifying the exception. |
48 //! | 48 //! |
49 //! This is an operating system-specific value. | 49 //! This is an operating system-specific value. |
50 //! | 50 //! |
51 //! For Mac OS X, this will be an \ref EXC_x "EXC_*" exception type, such as | 51 //! For Mac OS X, this will be an \ref EXC_x "EXC_*" exception type, such as |
52 //! `EXC_BAD_ACCESS`. `EXC_CRASH` will not appear here for exceptions | 52 //! `EXC_BAD_ACCESS`. `EXC_CRASH` will not appear here for exceptions |
53 //! processed as `EXC_CRASH` when generated from another preceding exception: | 53 //! processed as `EXC_CRASH` when generated from another preceding exception: |
54 //! the original exception code will appear instead. The exception type as it | 54 //! the original exception code will appear instead. The exception type as it |
55 //! was received will appear at index 0 of Codes(). | 55 //! was received will appear at index 0 of Codes(). |
| 56 //! |
| 57 //! For Windows, this will be an \ref EXCEPTION_x "EXCEPTION_*" exception type |
| 58 //! such as `EXCEPTION_ACCESS_VIOLATION`. |
56 virtual uint32_t Exception() const = 0; | 59 virtual uint32_t Exception() const = 0; |
57 | 60 |
58 //! \brief Returns the second-level exception code identifying the exception. | 61 //! \brief Returns the second-level exception code identifying the exception. |
59 //! | 62 //! |
60 //! This is an operating system-specific value. | 63 //! This is an operating system-specific value. |
61 //! | 64 //! |
62 //! For Mac OS X, this will be the value of the exception code at index 0 as | 65 //! For Mac OS X, this will be the value of the exception code at index 0 as |
63 //! received by a Mach exception handler, except: | 66 //! received by a Mach exception handler, except: |
64 //! * For `EXC_CRASH` exceptions generated from another preceding exception, | 67 //! * For `EXC_CRASH` exceptions generated from another preceding exception, |
65 //! the original exception code will appear here, not the code as received | 68 //! the original exception code will appear here, not the code as received |
66 //! by the Mach exception handler. | 69 //! by the Mach exception handler. |
67 //! * For `EXC_RESOURCE` and `EXC_GUARD` exceptions, the high 32 bits of the | 70 //! * For `EXC_RESOURCE` and `EXC_GUARD` exceptions, the high 32 bits of the |
68 //! exception code at index 0 will appear here. | 71 //! exception code at index 0 will appear here. |
69 //! | 72 //! |
70 //! In all cases on Mac OS X, the full exception code at index 0 as it was | 73 //! In all cases on Mac OS X, the full exception code at index 0 as it was |
71 //! received will appear at index 1 of Codes(). | 74 //! received will appear at index 1 of Codes(). |
| 75 //! |
| 76 //! On Windows, this will either be `0` if the exception is continuable, or |
| 77 //! `EXCEPTION_NONCONTINUABLE` to indicate a noncontinuable exception. |
72 virtual uint32_t ExceptionInfo() const = 0; | 78 virtual uint32_t ExceptionInfo() const = 0; |
73 | 79 |
74 //! \brief Returns the address that triggered the exception. | 80 //! \brief Returns the address that triggered the exception. |
75 //! | 81 //! |
76 //! This may be the address that caused a fault on data access, or it may be | 82 //! This may be the address that caused a fault on data access, or it may be |
77 //! the instruction pointer that contained an offending instruction. For | 83 //! the instruction pointer that contained an offending instruction. For |
78 //! exceptions where this value cannot be determined, it will be `0`. | 84 //! exceptions where this value cannot be determined, it will be `0`. |
79 //! | 85 //! |
80 //! For Mac OS X, this will be the value of the exception code at index 1 as | 86 //! For Mac OS X, this will be the value of the exception code at index 1 as |
81 //! received by a Mach exception handler. | 87 //! received by a Mach exception handler. |
82 virtual uint64_t ExceptionAddress() const = 0; | 88 virtual uint64_t ExceptionAddress() const = 0; |
83 | 89 |
84 //! \brief Returns a series of operating system-specific exception codes. | 90 //! \brief Returns a series of operating system-specific exception codes. |
85 //! | 91 //! |
86 //! The precise interpretation of these codes is specific to the snapshot | 92 //! The precise interpretation of these codes is specific to the snapshot |
87 //! operating system. These codes may provide a duplicate of information | 93 //! operating system. These codes may provide a duplicate of information |
88 //! available elsewhere, they may extend information available elsewhere, or | 94 //! available elsewhere, they may extend information available elsewhere, or |
89 //! they may not be present at all. In this case, an empty vector will be | 95 //! they may not be present at all. In this case, an empty vector will be |
90 //! returned. | 96 //! returned. |
91 //! | 97 //! |
92 //! For Mac OS X, this will be a vector containing the original exception type | 98 //! For Mac OS X, this will be a vector containing the original exception type |
93 //! and the values of `code[0]` and `code[1]` as received by a Mach exception | 99 //! and the values of `code[0]` and `code[1]` as received by a Mach exception |
94 //! handler. | 100 //! handler. |
| 101 //! |
| 102 //! For Windows, these are additional arguments (if any) as provided to |
| 103 //! `RaiseException()`. See the documentation for `ExceptionInformation` in |
| 104 //! `EXCEPTION_RECORD`. |
95 virtual const std::vector<uint64_t>& Codes() const = 0; | 105 virtual const std::vector<uint64_t>& Codes() const = 0; |
96 }; | 106 }; |
97 | 107 |
98 } // namespace crashpad | 108 } // namespace crashpad |
99 | 109 |
100 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_ | 110 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_ |
OLD | NEW |