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

Side by Side Diff: snapshot/mac/exception_snapshot_mac.h

Issue 1058523002: Add ConstThreadState to mach_extensions.h and use it everywhere (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: clang-unformat Created 5 years, 8 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
« no previous file with comments | « snapshot/mac/cpu_context_mac.cc ('k') | snapshot/mac/exception_snapshot_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_ 15 #ifndef CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
16 #define CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_ 16 #define CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
17 17
18 #include <mach/mach.h> 18 #include <mach/mach.h>
19 #include <stdint.h> 19 #include <stdint.h>
20 20
21 #include <vector> 21 #include <vector>
22 22
23 #include "base/basictypes.h" 23 #include "base/basictypes.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "snapshot/cpu_context.h" 25 #include "snapshot/cpu_context.h"
26 #include "snapshot/exception_snapshot.h" 26 #include "snapshot/exception_snapshot.h"
27 #include "util/mach/mach_extensions.h"
27 #include "util/misc/initialization_state_dcheck.h" 28 #include "util/misc/initialization_state_dcheck.h"
28 29
29 namespace crashpad { 30 namespace crashpad {
30 31
31 class ProcessReader; 32 class ProcessReader;
32 33
33 namespace internal { 34 namespace internal {
34 35
35 //! \brief An ExceptionSnapshot of an exception sustained by a running (or 36 //! \brief An ExceptionSnapshot of an exception sustained by a running (or
36 //! crashed) process on a Mac OS X system. 37 //! crashed) process on a Mac OS X system.
(...skipping 11 matching lines...) Expand all
48 //! exception. 49 //! exception.
49 //! 50 //!
50 //! \return `true` if the snapshot could be created, `false` otherwise with 51 //! \return `true` if the snapshot could be created, `false` otherwise with
51 //! an appropriate message logged. 52 //! an appropriate message logged.
52 bool Initialize(ProcessReader* process_reader, 53 bool Initialize(ProcessReader* process_reader,
53 thread_t exception_thread, 54 thread_t exception_thread,
54 exception_type_t exception, 55 exception_type_t exception,
55 const mach_exception_data_type_t* code, 56 const mach_exception_data_type_t* code,
56 mach_msg_type_number_t code_count, 57 mach_msg_type_number_t code_count,
57 thread_state_flavor_t flavor, 58 thread_state_flavor_t flavor,
58 const natural_t* state, 59 ConstThreadState state,
59 mach_msg_type_number_t state_count); 60 mach_msg_type_number_t state_count);
60 61
61 // ExceptionSnapshot: 62 // ExceptionSnapshot:
62 63
63 const CPUContext* Context() const override; 64 const CPUContext* Context() const override;
64 uint64_t ThreadID() const override; 65 uint64_t ThreadID() const override;
65 uint32_t Exception() const override; 66 uint32_t Exception() const override;
66 uint32_t ExceptionInfo() const override; 67 uint32_t ExceptionInfo() const override;
67 uint64_t ExceptionAddress() const override; 68 uint64_t ExceptionAddress() const override;
68 const std::vector<uint64_t>& Codes() const override; 69 const std::vector<uint64_t>& Codes() const override;
(...skipping 13 matching lines...) Expand all
82 uint32_t exception_code_0_; 83 uint32_t exception_code_0_;
83 InitializationStateDcheck initialized_; 84 InitializationStateDcheck initialized_;
84 85
85 DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotMac); 86 DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotMac);
86 }; 87 };
87 88
88 } // namespace internal 89 } // namespace internal
89 } // namespace crashpad 90 } // namespace crashpad
90 91
91 #endif // CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_ 92 #endif // CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
OLDNEW
« no previous file with comments | « snapshot/mac/cpu_context_mac.cc ('k') | snapshot/mac/exception_snapshot_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698