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, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 //! | 113 //! |
114 //! This interface is an alternative to Read() that does not require the | 114 //! This interface is an alternative to Read() that does not require the |
115 //! caller to provide a buffer to fill. This avoids copying memory, which can | 115 //! caller to provide a buffer to fill. This avoids copying memory, which can |
116 //! offer a performance improvement. | 116 //! offer a performance improvement. |
117 //! | 117 //! |
118 //! \param[in] address The address, in the target task’s address space, of the | 118 //! \param[in] address The address, in the target task’s address space, of the |
119 //! memory region to map. | 119 //! memory region to map. |
120 //! \param[in] size The size, in bytes, of the memory region to map. | 120 //! \param[in] size The size, in bytes, of the memory region to map. |
121 //! | 121 //! |
122 //! \return On success, a MappedMemory object that provides access to the data | 122 //! \return On success, a MappedMemory object that provides access to the data |
123 //! requested. On faliure, `NULL`, with a warning logged. Failures can | 123 //! requested. On faliure, `nullptr`, with a warning logged. Failures can |
124 //! occur, for example, when encountering unmapped or unreadable pages. | 124 //! occur, for example, when encountering unmapped or unreadable pages. |
125 scoped_ptr<MappedMemory> ReadMapped(mach_vm_address_t address, size_t size); | 125 scoped_ptr<MappedMemory> ReadMapped(mach_vm_address_t address, size_t size); |
126 | 126 |
127 //! \brief Reads a `NUL`-terminated C string from the target task into a | 127 //! \brief Reads a `NUL`-terminated C string from the target task into a |
128 //! string in the current task. | 128 //! string in the current task. |
129 //! | 129 //! |
130 //! The length of the string need not be known ahead of time. This method will | 130 //! The length of the string need not be known ahead of time. This method will |
131 //! read contiguous memory until a `NUL` terminator is found. | 131 //! read contiguous memory until a `NUL` terminator is found. |
132 //! | 132 //! |
133 //! \param[in] address The address, in the target task’s address space, of the | 133 //! \param[in] address The address, in the target task’s address space, of the |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 std::string* string); | 168 std::string* string); |
169 | 169 |
170 task_t task_; // weak | 170 task_t task_; // weak |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(TaskMemory); | 172 DISALLOW_COPY_AND_ASSIGN(TaskMemory); |
173 }; | 173 }; |
174 | 174 |
175 } // namespace crashpad | 175 } // namespace crashpad |
176 | 176 |
177 #endif // CRASHPAD_UTIL_MACH_TASK_MEMORY_H_ | 177 #endif // CRASHPAD_UTIL_MACH_TASK_MEMORY_H_ |
OLD | NEW |