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 void AddMemorySnapshot(WinVMAddress address, |
| 143 WinVMSize size, |
| 144 PointerVector<internal::MemorySnapshotWin>* into); |
| 145 |
| 146 template <class Traits> |
| 147 void AddMemorySnapshotForUNICODE_STRING( |
| 148 const process_types::UNICODE_STRING<Traits>& us, |
| 149 PointerVector<internal::MemorySnapshotWin>* into); |
| 150 |
| 151 template <class Traits> |
| 152 void AddMemorySnapshotForLdrLIST_ENTRY( |
| 153 const process_types::LIST_ENTRY<Traits>& le, |
| 154 size_t offset_of_member, |
| 155 PointerVector<internal::MemorySnapshotWin>* into); |
| 156 |
| 157 WinVMSize DetermineSizeOfEnvironmentBlock( |
| 158 WinVMAddress start_of_environment_block); |
| 159 |
137 internal::SystemSnapshotWin system_; | 160 internal::SystemSnapshotWin system_; |
138 internal::MemorySnapshotWin peb_; | 161 PointerVector<internal::MemorySnapshotWin> peb_memory_; |
139 PointerVector<internal::ThreadSnapshotWin> threads_; | 162 PointerVector<internal::ThreadSnapshotWin> threads_; |
140 PointerVector<internal::ModuleSnapshotWin> modules_; | 163 PointerVector<internal::ModuleSnapshotWin> modules_; |
141 scoped_ptr<internal::ExceptionSnapshotWin> exception_; | 164 scoped_ptr<internal::ExceptionSnapshotWin> exception_; |
142 ProcessReaderWin process_reader_; | 165 ProcessReaderWin process_reader_; |
143 UUID report_id_; | 166 UUID report_id_; |
144 UUID client_id_; | 167 UUID client_id_; |
145 std::map<std::string, std::string> annotations_simple_map_; | 168 std::map<std::string, std::string> annotations_simple_map_; |
146 timeval snapshot_time_; | 169 timeval snapshot_time_; |
147 InitializationStateDcheck initialized_; | 170 InitializationStateDcheck initialized_; |
148 | 171 |
149 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotWin); | 172 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotWin); |
150 }; | 173 }; |
151 | 174 |
152 } // namespace crashpad | 175 } // namespace crashpad |
153 | 176 |
154 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_SNAPSHOT_WIN_H_ | 177 #endif // CRASHPAD_SNAPSHOT_WIN_PROCESS_SNAPSHOT_WIN_H_ |
OLD | NEW |