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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 PLOG(ERROR) << "IsWow64Process"; | 52 PLOG(ERROR) << "IsWow64Process"; |
53 return false; | 53 return false; |
54 } | 54 } |
55 return !!is_wow64; | 55 return !!is_wow64; |
56 } | 56 } |
57 | 57 |
58 void VerifyAddressInInCodePage(const ProcessInfo& process_info, | 58 void VerifyAddressInInCodePage(const ProcessInfo& process_info, |
59 WinVMAddress code_address) { | 59 WinVMAddress code_address) { |
60 // Make sure the child code address is an code page address with the right | 60 // Make sure the child code address is an code page address with the right |
61 // information. | 61 // information. |
62 const std::vector<MEMORY_BASIC_INFORMATION64>& memory_info = | 62 const ProcessInfo::MemoryBasicInformation64Vector& memory_info = |
63 process_info.MemoryInfo(); | 63 process_info.MemoryInfo(); |
64 bool found_region = false; | 64 bool found_region = false; |
65 for (const auto& mi : memory_info) { | 65 for (const auto& mi : memory_info) { |
66 if (mi.BaseAddress <= code_address && | 66 if (mi.BaseAddress <= code_address && |
67 mi.BaseAddress + mi.RegionSize > code_address) { | 67 mi.BaseAddress + mi.RegionSize > code_address) { |
68 EXPECT_EQ(MEM_COMMIT, mi.State); | 68 EXPECT_EQ(MEM_COMMIT, mi.State); |
69 EXPECT_EQ(PAGE_EXECUTE_READ, mi.Protect); | 69 EXPECT_EQ(PAGE_EXECUTE_READ, mi.Protect); |
70 EXPECT_EQ(MEM_IMAGE, mi.Type); | 70 EXPECT_EQ(MEM_IMAGE, mi.Type); |
71 EXPECT_FALSE(found_region); | 71 EXPECT_FALSE(found_region); |
72 found_region = true; | 72 found_region = true; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 TEST(ProcessInfo, OtherProcessWOW64) { | 192 TEST(ProcessInfo, OtherProcessWOW64) { |
193 #ifndef NDEBUG | 193 #ifndef NDEBUG |
194 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Debug")); | 194 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Debug")); |
195 #else | 195 #else |
196 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Release")); | 196 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Release")); |
197 #endif | 197 #endif |
198 } | 198 } |
199 #endif // ARCH_CPU_64_BITS | 199 #endif // ARCH_CPU_64_BITS |
200 | 200 |
201 TEST(ProcessInfo, AccessibleRangesNone) { | 201 TEST(ProcessInfo, AccessibleRangesNone) { |
202 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 202 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
203 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 203 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
204 | 204 |
205 mbi.BaseAddress = 0; | 205 mbi.BaseAddress = 0; |
206 mbi.RegionSize = 10; | 206 mbi.RegionSize = 10; |
207 mbi.State = MEM_FREE; | 207 mbi.State = MEM_FREE; |
208 memory_info.push_back(mbi); | 208 memory_info.push_back(mbi); |
209 | 209 |
210 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 210 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
211 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(2, 4), | 211 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(2, 4), |
212 memory_info); | 212 memory_info); |
213 | 213 |
214 EXPECT_TRUE(result.empty()); | 214 EXPECT_TRUE(result.empty()); |
215 } | 215 } |
216 | 216 |
217 TEST(ProcessInfo, AccessibleRangesOneInside) { | 217 TEST(ProcessInfo, AccessibleRangesOneInside) { |
218 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 218 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
219 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 219 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
220 | 220 |
221 mbi.BaseAddress = 0; | 221 mbi.BaseAddress = 0; |
222 mbi.RegionSize = 10; | 222 mbi.RegionSize = 10; |
223 mbi.State = MEM_COMMIT; | 223 mbi.State = MEM_COMMIT; |
224 memory_info.push_back(mbi); | 224 memory_info.push_back(mbi); |
225 | 225 |
226 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 226 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
227 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(2, 4), | 227 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(2, 4), |
228 memory_info); | 228 memory_info); |
229 | 229 |
230 ASSERT_EQ(1u, result.size()); | 230 ASSERT_EQ(1u, result.size()); |
231 EXPECT_EQ(2, result[0].base()); | 231 EXPECT_EQ(2, result[0].base()); |
232 EXPECT_EQ(4, result[0].size()); | 232 EXPECT_EQ(4, result[0].size()); |
233 } | 233 } |
234 | 234 |
235 TEST(ProcessInfo, AccessibleRangesOneTruncatedSize) { | 235 TEST(ProcessInfo, AccessibleRangesOneTruncatedSize) { |
236 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 236 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
237 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 237 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
238 | 238 |
239 mbi.BaseAddress = 0; | 239 mbi.BaseAddress = 0; |
240 mbi.RegionSize = 10; | 240 mbi.RegionSize = 10; |
241 mbi.State = MEM_COMMIT; | 241 mbi.State = MEM_COMMIT; |
242 memory_info.push_back(mbi); | 242 memory_info.push_back(mbi); |
243 | 243 |
244 mbi.BaseAddress = 10; | 244 mbi.BaseAddress = 10; |
245 mbi.RegionSize = 20; | 245 mbi.RegionSize = 20; |
246 mbi.State = MEM_FREE; | 246 mbi.State = MEM_FREE; |
247 memory_info.push_back(mbi); | 247 memory_info.push_back(mbi); |
248 | 248 |
249 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 249 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
250 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 250 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
251 memory_info); | 251 memory_info); |
252 | 252 |
253 ASSERT_EQ(1u, result.size()); | 253 ASSERT_EQ(1u, result.size()); |
254 EXPECT_EQ(5, result[0].base()); | 254 EXPECT_EQ(5, result[0].base()); |
255 EXPECT_EQ(5, result[0].size()); | 255 EXPECT_EQ(5, result[0].size()); |
256 } | 256 } |
257 | 257 |
258 TEST(ProcessInfo, AccessibleRangesOneMovedStart) { | 258 TEST(ProcessInfo, AccessibleRangesOneMovedStart) { |
259 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 259 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
260 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 260 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
261 | 261 |
262 mbi.BaseAddress = 0; | 262 mbi.BaseAddress = 0; |
263 mbi.RegionSize = 10; | 263 mbi.RegionSize = 10; |
264 mbi.State = MEM_FREE; | 264 mbi.State = MEM_FREE; |
265 memory_info.push_back(mbi); | 265 memory_info.push_back(mbi); |
266 | 266 |
267 mbi.BaseAddress = 10; | 267 mbi.BaseAddress = 10; |
268 mbi.RegionSize = 20; | 268 mbi.RegionSize = 20; |
269 mbi.State = MEM_COMMIT; | 269 mbi.State = MEM_COMMIT; |
270 memory_info.push_back(mbi); | 270 memory_info.push_back(mbi); |
271 | 271 |
272 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 272 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
273 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 273 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
274 memory_info); | 274 memory_info); |
275 | 275 |
276 ASSERT_EQ(1u, result.size()); | 276 ASSERT_EQ(1u, result.size()); |
277 EXPECT_EQ(10, result[0].base()); | 277 EXPECT_EQ(10, result[0].base()); |
278 EXPECT_EQ(5, result[0].size()); | 278 EXPECT_EQ(5, result[0].size()); |
279 } | 279 } |
280 | 280 |
281 TEST(ProcessInfo, ReserveIsInaccessible) { | 281 TEST(ProcessInfo, ReserveIsInaccessible) { |
282 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 282 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
283 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 283 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
284 | 284 |
285 mbi.BaseAddress = 0; | 285 mbi.BaseAddress = 0; |
286 mbi.RegionSize = 10; | 286 mbi.RegionSize = 10; |
287 mbi.State = MEM_RESERVE; | 287 mbi.State = MEM_RESERVE; |
288 memory_info.push_back(mbi); | 288 memory_info.push_back(mbi); |
289 | 289 |
290 mbi.BaseAddress = 10; | 290 mbi.BaseAddress = 10; |
291 mbi.RegionSize = 20; | 291 mbi.RegionSize = 20; |
292 mbi.State = MEM_COMMIT; | 292 mbi.State = MEM_COMMIT; |
293 memory_info.push_back(mbi); | 293 memory_info.push_back(mbi); |
294 | 294 |
295 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 295 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
296 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 296 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
297 memory_info); | 297 memory_info); |
298 | 298 |
299 ASSERT_EQ(1u, result.size()); | 299 ASSERT_EQ(1u, result.size()); |
300 EXPECT_EQ(10, result[0].base()); | 300 EXPECT_EQ(10, result[0].base()); |
301 EXPECT_EQ(5, result[0].size()); | 301 EXPECT_EQ(5, result[0].size()); |
302 } | 302 } |
303 | 303 |
304 TEST(ProcessInfo, PageGuardIsInaccessible) { | 304 TEST(ProcessInfo, PageGuardIsInaccessible) { |
305 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 305 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
306 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 306 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
307 | 307 |
308 mbi.BaseAddress = 0; | 308 mbi.BaseAddress = 0; |
309 mbi.RegionSize = 10; | 309 mbi.RegionSize = 10; |
310 mbi.State = MEM_COMMIT; | 310 mbi.State = MEM_COMMIT; |
311 mbi.Protect = PAGE_GUARD; | 311 mbi.Protect = PAGE_GUARD; |
312 memory_info.push_back(mbi); | 312 memory_info.push_back(mbi); |
313 | 313 |
314 mbi.BaseAddress = 10; | 314 mbi.BaseAddress = 10; |
315 mbi.RegionSize = 20; | 315 mbi.RegionSize = 20; |
316 mbi.State = MEM_COMMIT; | 316 mbi.State = MEM_COMMIT; |
317 mbi.Protect = 0; | 317 mbi.Protect = 0; |
318 memory_info.push_back(mbi); | 318 memory_info.push_back(mbi); |
319 | 319 |
320 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 320 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
321 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 321 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
322 memory_info); | 322 memory_info); |
323 | 323 |
324 ASSERT_EQ(1u, result.size()); | 324 ASSERT_EQ(1u, result.size()); |
325 EXPECT_EQ(10, result[0].base()); | 325 EXPECT_EQ(10, result[0].base()); |
326 EXPECT_EQ(5, result[0].size()); | 326 EXPECT_EQ(5, result[0].size()); |
327 } | 327 } |
328 | 328 |
329 TEST(ProcessInfo, PageNoAccessIsInaccessible) { | 329 TEST(ProcessInfo, PageNoAccessIsInaccessible) { |
330 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 330 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
331 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 331 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
332 | 332 |
333 mbi.BaseAddress = 0; | 333 mbi.BaseAddress = 0; |
334 mbi.RegionSize = 10; | 334 mbi.RegionSize = 10; |
335 mbi.State = MEM_COMMIT; | 335 mbi.State = MEM_COMMIT; |
336 mbi.Protect = PAGE_NOACCESS; | 336 mbi.Protect = PAGE_NOACCESS; |
337 memory_info.push_back(mbi); | 337 memory_info.push_back(mbi); |
338 | 338 |
339 mbi.BaseAddress = 10; | 339 mbi.BaseAddress = 10; |
340 mbi.RegionSize = 20; | 340 mbi.RegionSize = 20; |
341 mbi.State = MEM_COMMIT; | 341 mbi.State = MEM_COMMIT; |
342 mbi.Protect = 0; | 342 mbi.Protect = 0; |
343 memory_info.push_back(mbi); | 343 memory_info.push_back(mbi); |
344 | 344 |
345 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 345 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
346 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 346 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
347 memory_info); | 347 memory_info); |
348 | 348 |
349 ASSERT_EQ(1u, result.size()); | 349 ASSERT_EQ(1u, result.size()); |
350 EXPECT_EQ(10, result[0].base()); | 350 EXPECT_EQ(10, result[0].base()); |
351 EXPECT_EQ(5, result[0].size()); | 351 EXPECT_EQ(5, result[0].size()); |
352 } | 352 } |
353 | 353 |
354 TEST(ProcessInfo, AccessibleRangesCoalesced) { | 354 TEST(ProcessInfo, AccessibleRangesCoalesced) { |
355 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 355 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
356 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 356 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
357 | 357 |
358 mbi.BaseAddress = 0; | 358 mbi.BaseAddress = 0; |
359 mbi.RegionSize = 10; | 359 mbi.RegionSize = 10; |
360 mbi.State = MEM_FREE; | 360 mbi.State = MEM_FREE; |
361 memory_info.push_back(mbi); | 361 memory_info.push_back(mbi); |
362 | 362 |
363 mbi.BaseAddress = 10; | 363 mbi.BaseAddress = 10; |
364 mbi.RegionSize = 2; | 364 mbi.RegionSize = 2; |
365 mbi.State = MEM_COMMIT; | 365 mbi.State = MEM_COMMIT; |
366 memory_info.push_back(mbi); | 366 memory_info.push_back(mbi); |
367 | 367 |
368 mbi.BaseAddress = 12; | 368 mbi.BaseAddress = 12; |
369 mbi.RegionSize = 5; | 369 mbi.RegionSize = 5; |
370 mbi.State = MEM_COMMIT; | 370 mbi.State = MEM_COMMIT; |
371 memory_info.push_back(mbi); | 371 memory_info.push_back(mbi); |
372 | 372 |
373 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 373 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
374 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(11, 4), | 374 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(11, 4), |
375 memory_info); | 375 memory_info); |
376 | 376 |
377 ASSERT_EQ(1u, result.size()); | 377 ASSERT_EQ(1u, result.size()); |
378 EXPECT_EQ(11, result[0].base()); | 378 EXPECT_EQ(11, result[0].base()); |
379 EXPECT_EQ(4, result[0].size()); | 379 EXPECT_EQ(4, result[0].size()); |
380 } | 380 } |
381 | 381 |
382 TEST(ProcessInfo, AccessibleRangesMiddleUnavailable) { | 382 TEST(ProcessInfo, AccessibleRangesMiddleUnavailable) { |
383 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 383 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
384 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 384 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
385 | 385 |
386 mbi.BaseAddress = 0; | 386 mbi.BaseAddress = 0; |
387 mbi.RegionSize = 10; | 387 mbi.RegionSize = 10; |
388 mbi.State = MEM_COMMIT; | 388 mbi.State = MEM_COMMIT; |
389 memory_info.push_back(mbi); | 389 memory_info.push_back(mbi); |
390 | 390 |
391 mbi.BaseAddress = 10; | 391 mbi.BaseAddress = 10; |
392 mbi.RegionSize = 5; | 392 mbi.RegionSize = 5; |
393 mbi.State = MEM_FREE; | 393 mbi.State = MEM_FREE; |
394 memory_info.push_back(mbi); | 394 memory_info.push_back(mbi); |
395 | 395 |
396 mbi.BaseAddress = 15; | 396 mbi.BaseAddress = 15; |
397 mbi.RegionSize = 100; | 397 mbi.RegionSize = 100; |
398 mbi.State = MEM_COMMIT; | 398 mbi.State = MEM_COMMIT; |
399 memory_info.push_back(mbi); | 399 memory_info.push_back(mbi); |
400 | 400 |
401 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 401 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
402 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 45), | 402 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 45), |
403 memory_info); | 403 memory_info); |
404 | 404 |
405 ASSERT_EQ(2u, result.size()); | 405 ASSERT_EQ(2u, result.size()); |
406 EXPECT_EQ(5, result[0].base()); | 406 EXPECT_EQ(5, result[0].base()); |
407 EXPECT_EQ(5, result[0].size()); | 407 EXPECT_EQ(5, result[0].size()); |
408 EXPECT_EQ(15, result[1].base()); | 408 EXPECT_EQ(15, result[1].base()); |
409 EXPECT_EQ(35, result[1].size()); | 409 EXPECT_EQ(35, result[1].size()); |
410 } | 410 } |
411 | 411 |
412 TEST(ProcessInfo, RequestedBeforeMap) { | 412 TEST(ProcessInfo, RequestedBeforeMap) { |
413 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 413 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
414 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 414 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
415 | 415 |
416 mbi.BaseAddress = 10; | 416 mbi.BaseAddress = 10; |
417 mbi.RegionSize = 10; | 417 mbi.RegionSize = 10; |
418 mbi.State = MEM_COMMIT; | 418 mbi.State = MEM_COMMIT; |
419 memory_info.push_back(mbi); | 419 memory_info.push_back(mbi); |
420 | 420 |
421 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 421 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
422 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), | 422 GetReadableRangesOfMemoryMap(CheckedRange<WinVMAddress, WinVMSize>(5, 10), |
423 memory_info); | 423 memory_info); |
424 | 424 |
425 ASSERT_EQ(1u, result.size()); | 425 ASSERT_EQ(1u, result.size()); |
426 EXPECT_EQ(10, result[0].base()); | 426 EXPECT_EQ(10, result[0].base()); |
427 EXPECT_EQ(5, result[0].size()); | 427 EXPECT_EQ(5, result[0].size()); |
428 } | 428 } |
429 | 429 |
430 TEST(ProcessInfo, RequestedAfterMap) { | 430 TEST(ProcessInfo, RequestedAfterMap) { |
431 std::vector<MEMORY_BASIC_INFORMATION64> memory_info; | 431 ProcessInfo::MemoryBasicInformation64Vector memory_info; |
432 MEMORY_BASIC_INFORMATION64 mbi = {0}; | 432 MEMORY_BASIC_INFORMATION64 mbi = {0}; |
433 | 433 |
434 mbi.BaseAddress = 10; | 434 mbi.BaseAddress = 10; |
435 mbi.RegionSize = 10; | 435 mbi.RegionSize = 10; |
436 mbi.State = MEM_COMMIT; | 436 mbi.State = MEM_COMMIT; |
437 memory_info.push_back(mbi); | 437 memory_info.push_back(mbi); |
438 | 438 |
439 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = | 439 std::vector<CheckedRange<WinVMAddress, WinVMSize>> result = |
440 GetReadableRangesOfMemoryMap( | 440 GetReadableRangesOfMemoryMap( |
441 CheckedRange<WinVMAddress, WinVMSize>(15, 100), memory_info); | 441 CheckedRange<WinVMAddress, WinVMSize>(15, 100), memory_info); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 EXPECT_TRUE( | 639 EXPECT_TRUE( |
640 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>( | 640 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>( |
641 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize))); | 641 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize))); |
642 EXPECT_FALSE(info.LoggingRangeIsFullyReadable( | 642 EXPECT_FALSE(info.LoggingRangeIsFullyReadable( |
643 CheckedRange<WinVMAddress, WinVMSize>(0, 1024))); | 643 CheckedRange<WinVMAddress, WinVMSize>(0, 1024))); |
644 } | 644 } |
645 | 645 |
646 } // namespace | 646 } // namespace |
647 } // namespace test | 647 } // namespace test |
648 } // namespace crashpad | 648 } // namespace crashpad |
OLD | NEW |