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

Side by Side Diff: util/mac/mach_o_image_segment_reader.h

Issue 535343004: Add MachOImageReader and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 3 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
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,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 //! \return A pointer to the section information. If \a index is out of range, 133 //! \return A pointer to the section information. If \a index is out of range,
134 //! execution is aborted. 134 //! execution is aborted.
135 //! 135 //!
136 //! \note The process_types::section::addr field gives the section’s preferred 136 //! \note The process_types::section::addr field gives the section’s preferred
137 //! load address as stored in the Mach-O image file, and is not adjusted 137 //! load address as stored in the Mach-O image file, and is not adjusted
138 //! for any “slide” that may have occurred when the image was loaded. 138 //! for any “slide” that may have occurred when the image was loaded.
139 //! 139 //!
140 //! \sa MachOImageReader::GetSectionAtIndex() 140 //! \sa MachOImageReader::GetSectionAtIndex()
141 const process_types::section* GetSectionAtIndex(size_t index) const; 141 const process_types::section* GetSectionAtIndex(size_t index) const;
142 142
143 //! Returns whether the segment slides.
144 //!
145 //! Most segments slide, but the __PAGEZERO segment does not, it grows
146 //! instead. This method identifies non-sliding segments in the same way that
147 //! the kernel does.
148 bool SegmentSlides() const;
149
143 //! \brief Returns a segment name string. 150 //! \brief Returns a segment name string.
144 //! 151 //!
145 //! Segment names may be 16 characters long, and are not necessarily 152 //! Segment names may be 16 characters long, and are not necessarily
146 //! `NUL`-terminated. This function will return a segment name based on up to 153 //! `NUL`-terminated. This function will return a segment name based on up to
147 //! the first 16 characters found at \a segment_name_c. 154 //! the first 16 characters found at \a segment_name_c.
148 static std::string SegmentNameString(const char* segment_name_c); 155 static std::string SegmentNameString(const char* segment_name_c);
149 156
150 //! \brief Returns a section name string. 157 //! \brief Returns a section name string.
151 //! 158 //!
152 //! Section names may be 16 characters long, and are not necessarily 159 //! Section names may be 16 characters long, and are not necessarily
(...skipping 30 matching lines...) Expand all
183 std::map<std::string, size_t> section_map_; 190 std::map<std::string, size_t> section_map_;
184 191
185 InitializationStateDcheck initialized_; 192 InitializationStateDcheck initialized_;
186 193
187 DISALLOW_COPY_AND_ASSIGN(MachOImageSegmentReader); 194 DISALLOW_COPY_AND_ASSIGN(MachOImageSegmentReader);
188 }; 195 };
189 196
190 } // namespace crashpad 197 } // namespace crashpad
191 198
192 #endif // CRASHPAD_UTIL_MAC_MACH_O_IMAGE_SEGMENT_READER_H_ 199 #endif // CRASHPAD_UTIL_MAC_MACH_O_IMAGE_SEGMENT_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698