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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 //! | 43 //! |
44 //! This value can be compared to ThreadSnapshot::ThreadID() to associate an | 44 //! This value can be compared to ThreadSnapshot::ThreadID() to associate an |
45 //! ExceptionSnapshot object with the ThreadSnapshot that contains a snapshot | 45 //! ExceptionSnapshot object with the ThreadSnapshot that contains a snapshot |
46 //! of the thread that triggered the exception. | 46 //! of the thread that triggered the exception. |
47 virtual uint64_t ThreadID() const = 0; | 47 virtual uint64_t ThreadID() const = 0; |
48 | 48 |
49 //! \brief Returns the top-level exception code identifying the exception. | 49 //! \brief Returns the top-level exception code identifying the exception. |
50 //! | 50 //! |
51 //! This is an operating system-specific value. | 51 //! This is an operating system-specific value. |
52 //! | 52 //! |
53 //! For Mac OS X, this will be an \ref EXC_x "EXC_*" exception type, such as | 53 //! For macOS, this will be an \ref EXC_x "EXC_*" exception type, such as |
54 //! `EXC_BAD_ACCESS`. `EXC_CRASH` will not appear here for exceptions | 54 //! `EXC_BAD_ACCESS`. `EXC_CRASH` will not appear here for exceptions |
55 //! processed as `EXC_CRASH` when generated from another preceding exception: | 55 //! processed as `EXC_CRASH` when generated from another preceding exception: |
56 //! the original exception code will appear instead. The exception type as it | 56 //! the original exception code will appear instead. The exception type as it |
57 //! was received will appear at index 0 of Codes(). | 57 //! was received will appear at index 0 of Codes(). |
58 //! | 58 //! |
59 //! For Windows, this will be an \ref EXCEPTION_x "EXCEPTION_*" exception type | 59 //! For Windows, this will be an `EXCEPTION_*` exception type, such as |
60 //! such as `EXCEPTION_ACCESS_VIOLATION`. | 60 //! `EXCEPTION_ACCESS_VIOLATION`. |
61 virtual uint32_t Exception() const = 0; | 61 virtual uint32_t Exception() const = 0; |
62 | 62 |
63 //! \brief Returns the second-level exception code identifying the exception. | 63 //! \brief Returns the second-level exception code identifying the exception. |
64 //! | 64 //! |
65 //! This is an operating system-specific value. | 65 //! This is an operating system-specific value. |
66 //! | 66 //! |
67 //! For Mac OS X, this will be the value of the exception code at index 0 as | 67 //! For macOS, this will be the value of the exception code at index 0 as |
68 //! received by a Mach exception handler, except: | 68 //! received by a Mach exception handler, except: |
69 //! * For `EXC_CRASH` exceptions generated from another preceding exception, | 69 //! * For `EXC_CRASH` exceptions generated from another preceding exception, |
70 //! the original exception code will appear here, not the code as received | 70 //! the original exception code will appear here, not the code as received |
71 //! by the Mach exception handler. | 71 //! by the Mach exception handler. |
72 //! * For `EXC_RESOURCE` and `EXC_GUARD` exceptions, the high 32 bits of the | 72 //! * For `EXC_RESOURCE` and `EXC_GUARD` exceptions, the high 32 bits of the |
73 //! exception code at index 0 will appear here. | 73 //! exception code at index 0 will appear here. |
74 //! | 74 //! |
75 //! In all cases on Mac OS X, the full exception code at index 0 as it was | 75 //! In all cases on macOS, the full exception code at index 0 as it was |
76 //! received will appear at index 1 of Codes(). | 76 //! received will appear at index 1 of Codes(). |
77 //! | 77 //! |
78 //! On Windows, this will either be `0` if the exception is continuable, or | 78 //! On Windows, this will either be `0` if the exception is continuable, or |
79 //! `EXCEPTION_NONCONTINUABLE` to indicate a noncontinuable exception. | 79 //! `EXCEPTION_NONCONTINUABLE` to indicate a noncontinuable exception. |
80 virtual uint32_t ExceptionInfo() const = 0; | 80 virtual uint32_t ExceptionInfo() const = 0; |
81 | 81 |
82 //! \brief Returns the address that triggered the exception. | 82 //! \brief Returns the address that triggered the exception. |
83 //! | 83 //! |
84 //! This may be the address that caused a fault on data access, or it may be | 84 //! This may be the address that caused a fault on data access, or it may be |
85 //! the instruction pointer that contained an offending instruction. For | 85 //! the instruction pointer that contained an offending instruction. For |
86 //! exceptions where this value cannot be determined, it will be `0`. | 86 //! exceptions where this value cannot be determined, it will be `0`. |
87 //! | 87 //! |
88 //! For Mac OS X, this will be the value of the exception code at index 1 as | 88 //! For macOS, this will be the value of the exception code at index 1 as |
89 //! received by a Mach exception handler. | 89 //! received by a Mach exception handler. |
90 virtual uint64_t ExceptionAddress() const = 0; | 90 virtual uint64_t ExceptionAddress() const = 0; |
91 | 91 |
92 //! \brief Returns a series of operating system-specific exception codes. | 92 //! \brief Returns a series of operating system-specific exception codes. |
93 //! | 93 //! |
94 //! The precise interpretation of these codes is specific to the snapshot | 94 //! The precise interpretation of these codes is specific to the snapshot |
95 //! operating system. These codes may provide a duplicate of information | 95 //! operating system. These codes may provide a duplicate of information |
96 //! available elsewhere, they may extend information available elsewhere, or | 96 //! available elsewhere, they may extend information available elsewhere, or |
97 //! they may not be present at all. In this case, an empty vector will be | 97 //! they may not be present at all. In this case, an empty vector will be |
98 //! returned. | 98 //! returned. |
99 //! | 99 //! |
100 //! For Mac OS X, this will be a vector containing the original exception type | 100 //! For macOS, this will be a vector containing the original exception type |
101 //! and the values of `code[0]` and `code[1]` as received by a Mach exception | 101 //! and the values of `code[0]` and `code[1]` as received by a Mach exception |
102 //! handler. | 102 //! handler. |
103 //! | 103 //! |
104 //! For Windows, these are additional arguments (if any) as provided to | 104 //! For Windows, these are additional arguments (if any) as provided to |
105 //! `RaiseException()`. See the documentation for `ExceptionInformation` in | 105 //! `RaiseException()`. See the documentation for `ExceptionInformation` in |
106 //! `EXCEPTION_RECORD`. | 106 //! `EXCEPTION_RECORD`. |
107 virtual const std::vector<uint64_t>& Codes() const = 0; | 107 virtual const std::vector<uint64_t>& Codes() const = 0; |
108 | 108 |
109 //! \brief Returns a vector of additional memory blocks that should be | 109 //! \brief Returns a vector of additional memory blocks that should be |
110 //! included in a minidump. | 110 //! included in a minidump. |
111 //! | 111 //! |
112 //! \return A vector of MemorySnapshot objects that will be included in the | 112 //! \return A vector of MemorySnapshot objects that will be included in the |
113 //! crash dump. The caller does not take ownership of these objects, they | 113 //! crash dump. The caller does not take ownership of these objects, they |
114 //! are scoped to the lifetime of the ThreadSnapshot object that they | 114 //! are scoped to the lifetime of the ThreadSnapshot object that they |
115 //! were obtained from. | 115 //! were obtained from. |
116 virtual std::vector<const MemorySnapshot*> ExtraMemory() const = 0; | 116 virtual std::vector<const MemorySnapshot*> ExtraMemory() const = 0; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace crashpad | 119 } // namespace crashpad |
120 | 120 |
121 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_ | 121 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_ |
OLD | NEW |