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, |
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_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ | 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ |
16 #define CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ | 16 #define CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ |
17 | 17 |
18 #include <windows.h> | 18 #include <windows.h> |
19 #include <dbghelp.h> | 19 #include <dbghelp.h> |
20 #include <stdint.h> | 20 #include <stdint.h> |
21 #include <sys/types.h> | 21 #include <sys/types.h> |
22 | 22 |
23 #include <vector> | 23 #include <vector> |
24 | 24 |
25 #include "base/basictypes.h" | 25 #include "base/basictypes.h" |
26 #include "base/memory/scoped_ptr.h" | 26 #include "base/memory/scoped_ptr.h" |
27 #include "minidump/minidump_stream_writer.h" | 27 #include "minidump/minidump_stream_writer.h" |
28 #include "minidump/minidump_writable.h" | 28 #include "minidump/minidump_writable.h" |
| 29 #include "util/file/file_io.h" |
29 #include "util/stdlib/pointer_container.h" | 30 #include "util/stdlib/pointer_container.h" |
30 | 31 |
31 namespace crashpad { | 32 namespace crashpad { |
32 | 33 |
33 class MemorySnapshot; | 34 class MemorySnapshot; |
34 | 35 |
35 //! \brief The base class for writers of memory ranges pointed to by | 36 //! \brief The base class for writers of memory ranges pointed to by |
36 //! MINIDUMP_MEMORY_DESCRIPTOR objects in a minidump file. | 37 //! MINIDUMP_MEMORY_DESCRIPTOR objects in a minidump file. |
37 //! | 38 //! |
38 //! This is an abstract base class because users are expected to provide their | 39 //! This is an abstract base class because users are expected to provide their |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 //! | 99 //! |
99 //! Memory regions are aligned to a 16-byte boundary. The actual alignment | 100 //! Memory regions are aligned to a 16-byte boundary. The actual alignment |
100 //! requirements of any data within the memory region are unknown, and may be | 101 //! requirements of any data within the memory region are unknown, and may be |
101 //! more or less strict than this depending on the platform. | 102 //! more or less strict than this depending on the platform. |
102 //! | 103 //! |
103 //! \return `16`. | 104 //! \return `16`. |
104 //! | 105 //! |
105 //! \note Valid in #kStateFrozen or any subsequent state. | 106 //! \note Valid in #kStateFrozen or any subsequent state. |
106 size_t Alignment() override; | 107 size_t Alignment() override; |
107 | 108 |
108 bool WillWriteAtOffsetImpl(off_t offset) override; | 109 bool WillWriteAtOffsetImpl(FileOffset offset) override; |
109 | 110 |
110 //! \brief Returns the object’s desired write phase. | 111 //! \brief Returns the object’s desired write phase. |
111 //! | 112 //! |
112 //! Memory regions are written at the end of minidump files, because it is | 113 //! Memory regions are written at the end of minidump files, because it is |
113 //! expected that unlike most other data in a minidump file, the contents of | 114 //! expected that unlike most other data in a minidump file, the contents of |
114 //! memory regions will be accessed sparsely. | 115 //! memory regions will be accessed sparsely. |
115 //! | 116 //! |
116 //! \return #kPhaseLate. | 117 //! \return #kPhaseLate. |
117 //! | 118 //! |
118 //! \note Valid in any state. | 119 //! \note Valid in any state. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 std::vector<MinidumpMemoryWriter*> memory_writers_; // weak | 184 std::vector<MinidumpMemoryWriter*> memory_writers_; // weak |
184 PointerVector<MinidumpMemoryWriter> children_; | 185 PointerVector<MinidumpMemoryWriter> children_; |
185 MINIDUMP_MEMORY_LIST memory_list_base_; | 186 MINIDUMP_MEMORY_LIST memory_list_base_; |
186 | 187 |
187 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter); | 188 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter); |
188 }; | 189 }; |
189 | 190 |
190 } // namespace crashpad | 191 } // namespace crashpad |
191 | 192 |
192 #endif // CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ | 193 #endif // CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ |
OLD | NEW |