@@ -140,15 +140,16 @@ class MinidumpFile : public Binary {
140
140
size_t Stride;
141
141
};
142
142
143
- class Memory64Iterator {
143
+ class Memory64Iterator {
144
144
public:
145
- static Memory64Iterator begin (ArrayRef<uint8_t > Storage, ArrayRef<minidump::MemoryDescriptor_64> Descriptors, uint64_t BaseRVA) {
145
+ static Memory64Iterator
146
+ begin (ArrayRef<uint8_t > Storage,
147
+ ArrayRef<minidump::MemoryDescriptor_64> Descriptors,
148
+ uint64_t BaseRVA) {
146
149
return Memory64Iterator (Storage, Descriptors, BaseRVA);
147
150
}
148
151
149
- static Memory64Iterator end () {
150
- return Memory64Iterator ();
151
- }
152
+ static Memory64Iterator end () { return Memory64Iterator (); }
152
153
153
154
std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t >> Current;
154
155
@@ -158,28 +159,31 @@ class Memory64Iterator {
158
159
159
160
bool operator !=(const Memory64Iterator &R) const { return !(*this == R); }
160
161
161
- const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t >> &operator *() const {
162
+ const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t >> &
163
+ operator *() const {
162
164
return Current;
163
165
}
164
166
165
- const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t >> *operator ->() const {
167
+ const std::pair<minidump::MemoryDescriptor_64, ArrayRef<uint8_t >> *
168
+ operator ->() const {
166
169
return &Current;
167
170
}
168
171
169
172
Error inc () {
170
173
if (Storage.size () == 0 || Descriptors.size () == 0 )
171
- return make_error<GenericBinaryError>(" No Memory64List Stream" , object_error::parse_failed);
174
+ return make_error<GenericBinaryError>(" No Memory64List Stream" ,
175
+ object_error::parse_failed);
172
176
173
177
if (Index >= Descriptors.size ())
174
178
return createError (" Can't read past of Memory64List Stream" );
175
179
176
180
const minidump::MemoryDescriptor_64 &Descriptor = Descriptors[Index];
177
181
if (RVA + Descriptor.DataSize > Storage.size ())
178
- return make_error<GenericBinaryError>(" Memory64 Descriptor exceeds end of file." ,
179
- object_error::unexpected_eof);
182
+ return make_error<GenericBinaryError>(
183
+ " Memory64 Descriptor exceeds end of file." ,
184
+ object_error::unexpected_eof);
180
185
181
- ArrayRef<uint8_t > Content =
182
- Storage.slice (RVA, Descriptor.DataSize );
186
+ ArrayRef<uint8_t > Content = Storage.slice (RVA, Descriptor.DataSize );
183
187
Current = std::make_pair (Descriptor, Content);
184
188
RVA += Descriptor.DataSize ;
185
189
Index++;
@@ -190,13 +194,14 @@ class Memory64Iterator {
190
194
191
195
private:
192
196
Memory64Iterator (ArrayRef<uint8_t > Storage,
193
- ArrayRef<minidump::MemoryDescriptor_64> Descriptors,
194
- uint64_t BaseRVA)
195
- : RVA(BaseRVA), Storage(Storage),
196
- Descriptors (Descriptors), isEnd(false ) {}
197
-
198
- Memory64Iterator () : RVA(0 ),
199
- Storage(ArrayRef<uint8_t >()), Descriptors(ArrayRef<minidump::MemoryDescriptor_64>()), isEnd(true ) {}
197
+ ArrayRef<minidump::MemoryDescriptor_64> Descriptors,
198
+ uint64_t BaseRVA)
199
+ : RVA(BaseRVA), Storage(Storage), Descriptors(Descriptors),
200
+ isEnd (false ) {}
201
+
202
+ Memory64Iterator ()
203
+ : RVA(0 ), Storage(ArrayRef<uint8_t >()),
204
+ Descriptors(ArrayRef<minidump::MemoryDescriptor_64>()), isEnd(true ) {}
200
205
201
206
size_t Index = 0 ;
202
207
uint64_t RVA;
@@ -211,7 +216,8 @@ class Memory64Iterator {
211
216
// / content from the Memory64List stream. An error is returned if the file
212
217
// / does not contain a Memory64List stream, or if the descriptor data is
213
218
// / unreadable.
214
- Expected<iterator_range<FallibleMemory64Iterator>> getMemory64List (Error &Err) const ;
219
+ Expected<iterator_range<FallibleMemory64Iterator>>
220
+ getMemory64List (Error &Err) const ;
215
221
216
222
// / Returns the list of descriptors embedded in the MemoryInfoList stream. The
217
223
// / descriptors provide properties (e.g. permissions) of interesting regions
0 commit comments