Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: snapshot/exception_snapshot.h

Issue 1126413008: win: Implement exception snapshot (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: tidy Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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().
Mark Mentovai 2015/08/18 16:17:19 Is there anything we should say about Windows here
scottmg 2015/08/18 16:56:00 Done.
72 virtual uint32_t ExceptionInfo() const = 0; 75 virtual uint32_t ExceptionInfo() const = 0;
73 76
74 //! \brief Returns the address that triggered the exception. 77 //! \brief Returns the address that triggered the exception.
75 //! 78 //!
76 //! This may be the address that caused a fault on data access, or it may be 79 //! 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 80 //! the instruction pointer that contained an offending instruction. For
78 //! exceptions where this value cannot be determined, it will be `0`. 81 //! exceptions where this value cannot be determined, it will be `0`.
79 //! 82 //!
80 //! For Mac OS X, this will be the value of the exception code at index 1 as 83 //! For Mac OS X, this will be the value of the exception code at index 1 as
81 //! received by a Mach exception handler. 84 //! received by a Mach exception handler.
82 virtual uint64_t ExceptionAddress() const = 0; 85 virtual uint64_t ExceptionAddress() const = 0;
83 86
84 //! \brief Returns a series of operating system-specific exception codes. 87 //! \brief Returns a series of operating system-specific exception codes.
85 //! 88 //!
86 //! The precise interpretation of these codes is specific to the snapshot 89 //! The precise interpretation of these codes is specific to the snapshot
87 //! operating system. These codes may provide a duplicate of information 90 //! operating system. These codes may provide a duplicate of information
88 //! available elsewhere, they may extend information available elsewhere, or 91 //! 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 92 //! they may not be present at all. In this case, an empty vector will be
90 //! returned. 93 //! returned.
91 //! 94 //!
92 //! For Mac OS X, this will be a vector containing the original exception type 95 //! 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 96 //! and the values of `code[0]` and `code[1]` as received by a Mach exception
94 //! handler. 97 //! handler.
Mark Mentovai 2015/08/18 16:17:19 Or here?
scottmg 2015/08/18 16:56:00 Done.
95 virtual const std::vector<uint64_t>& Codes() const = 0; 98 virtual const std::vector<uint64_t>& Codes() const = 0;
96 }; 99 };
97 100
98 } // namespace crashpad 101 } // namespace crashpad
99 102
100 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_ 103 #endif // CRASHPAD_SNAPSHOT_EXCEPTION_SNAPSHOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698