OLD | NEW |
---|---|
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 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 22 matching lines...) Expand all Loading... | |
33 #include "snapshot/system_snapshot.h" | 33 #include "snapshot/system_snapshot.h" |
34 #include "snapshot/thread_snapshot.h" | 34 #include "snapshot/thread_snapshot.h" |
35 #include "snapshot/win/exception_snapshot_win.h" | 35 #include "snapshot/win/exception_snapshot_win.h" |
36 #include "snapshot/win/memory_snapshot_win.h" | 36 #include "snapshot/win/memory_snapshot_win.h" |
37 #include "snapshot/win/module_snapshot_win.h" | 37 #include "snapshot/win/module_snapshot_win.h" |
38 #include "snapshot/win/system_snapshot_win.h" | 38 #include "snapshot/win/system_snapshot_win.h" |
39 #include "snapshot/win/thread_snapshot_win.h" | 39 #include "snapshot/win/thread_snapshot_win.h" |
40 #include "util/misc/initialization_state_dcheck.h" | 40 #include "util/misc/initialization_state_dcheck.h" |
41 #include "util/misc/uuid.h" | 41 #include "util/misc/uuid.h" |
42 #include "util/win/address_types.h" | 42 #include "util/win/address_types.h" |
43 #include "util/win/process_structs.h" | |
43 #include "util/stdlib/pointer_container.h" | 44 #include "util/stdlib/pointer_container.h" |
44 | 45 |
45 namespace crashpad { | 46 namespace crashpad { |
46 | 47 |
47 //! \brief A ProcessSnapshot of a running (or crashed) process running on a | 48 //! \brief A ProcessSnapshot of a running (or crashed) process running on a |
48 //! Windows system. | 49 //! Windows system. |
49 class ProcessSnapshotWin final : public ProcessSnapshot { | 50 class ProcessSnapshotWin final : public ProcessSnapshot { |
50 public: | 51 public: |
51 ProcessSnapshotWin(); | 52 ProcessSnapshotWin(); |
52 ~ProcessSnapshotWin() override; | 53 ~ProcessSnapshotWin() override; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 const ExceptionSnapshot* Exception() const override; | 128 const ExceptionSnapshot* Exception() const override; |
128 std::vector<const MemorySnapshot*> ExtraMemory() const override; | 129 std::vector<const MemorySnapshot*> ExtraMemory() const override; |
129 | 130 |
130 private: | 131 private: |
131 // Initializes threads_ on behalf of Initialize(). | 132 // Initializes threads_ on behalf of Initialize(). |
132 void InitializeThreads(); | 133 void InitializeThreads(); |
133 | 134 |
134 // Initializes modules_ on behalf of Initialize(). | 135 // Initializes modules_ on behalf of Initialize(). |
135 void InitializeModules(); | 136 void InitializeModules(); |
136 | 137 |
138 // Initializes peb_memory_ on behalf of Initialize(). | |
139 template <class Traits> | |
140 void InitializePebData(); | |
141 | |
142 internal::MemorySnapshotWin* CreateMemorySnapshot(WinVMAddress address, | |
143 WinVMAddress size); | |
144 template <class Traits> | |
Mark Mentovai
2015/09/25 21:10:16
Blank line before this.
scottmg
2015/09/25 22:52:25
Done.
| |
145 internal::MemorySnapshotWin* CreateMemorySnapshotForUNICODE_STRING( | |
146 const process_types::UNICODE_STRING<Traits>& us) { | |
147 return CreateMemorySnapshot(us.Buffer, us.MaximumLength); | |
Mark Mentovai
2015/09/25 21:10:17
Length instead of MaximumLength? We don’t need to
scottmg
2015/09/25 22:52:25
Done. (Can't use us.Buffer[0] because it's Traits:
| |
148 } | |
149 | |
137 internal::SystemSnapshotWin system_; | 150 internal::SystemSnapshotWin system_; |
138 internal::MemorySnapshotWin peb_; | 151 PointerVector<internal::MemorySnapshotWin> peb_memory_; |
139 PointerVector<internal::ThreadSnapshotWin> threads_; | 152 PointerVector<internal::ThreadSnapshotWin> threads_; |
140 PointerVector<internal::ModuleSnapshotWin> modules_; | 153 PointerVector<internal::ModuleSnapshotWin> modules_; |
141 scoped_ptr<internal::ExceptionSnapshotWin> exception_; | 154 scoped_ptr<internal::ExceptionSnapshotWin> exception_; |
142 ProcessReaderWin process_reader_; | 155 ProcessReaderWin process_reader_; |
143 UUID report_id_; | 156 UUID report_id_; |
144 UUID client_id_; | 157 UUID client_id_; |
145 std::map<std::string, std::string> annotations_simple_map_; | 158 std::map<std::string, std::string> annotations_simple_map_; |
146 timeval snapshot_time_; | 159 timeval snapshot_time_; |
147 InitializationStateDcheck initialized_; | 160 InitializationStateDcheck initialized_; |
148 | 161 |
149 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotWin); | 162 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotWin); |
150 }; | 163 }; |
151 | 164 |
152 } // namespace crashpad | 165 } // namespace crashpad |
153 | 166 |
154 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_SNAPSHOT_WIN_H_ | 167 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_SNAPSHOT_WIN_H_ |
OLD | NEW |