OLD | NEW |
1 // Copyright 2016 The Crashpad Authors. All rights reserved. | 1 // Copyright 2016 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 .Append(directory_modification) | 51 .Append(directory_modification) |
52 .Append(test_executable.BaseName().RemoveFinalExtension().value() + | 52 .Append(test_executable.BaseName().RemoveFinalExtension().value() + |
53 L"_extra_memory_ranges.exe") | 53 L"_extra_memory_ranges.exe") |
54 .value(); | 54 .value(); |
55 ChildLauncher child(child_test_executable, L""); | 55 ChildLauncher child(child_test_executable, L""); |
56 child.Start(); | 56 child.Start(); |
57 | 57 |
58 // Wait for the child process to indicate that it's done setting up its | 58 // Wait for the child process to indicate that it's done setting up its |
59 // annotations via the CrashpadInfo interface. | 59 // annotations via the CrashpadInfo interface. |
60 char c; | 60 char c; |
61 CheckedReadFile(child.stdout_read_handle(), &c, sizeof(c)); | 61 CheckedReadFileExactly(child.stdout_read_handle(), &c, sizeof(c)); |
62 | 62 |
63 ProcessSnapshotWin snapshot; | 63 ProcessSnapshotWin snapshot; |
64 ASSERT_TRUE(snapshot.Initialize( | 64 ASSERT_TRUE(snapshot.Initialize( |
65 child.process_handle(), ProcessSuspensionState::kRunning, 0, 0)); | 65 child.process_handle(), ProcessSuspensionState::kRunning, 0, 0)); |
66 | 66 |
67 // Verify the extra memory ranges set via the CrashpadInfo interface. | 67 // Verify the extra memory ranges set via the CrashpadInfo interface. |
68 std::set<CheckedRange<uint64_t>> all_ranges; | 68 std::set<CheckedRange<uint64_t>> all_ranges; |
69 for (const auto* module : snapshot.Modules()) { | 69 for (const auto* module : snapshot.Modules()) { |
70 for (const auto& range : module->ExtraMemoryRanges()) | 70 for (const auto& range : module->ExtraMemoryRanges()) |
71 all_ranges.insert(range); | 71 all_ranges.insert(range); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 #else | 124 #else |
125 TestExtraMemoryRanges(kCrashDebugBreak, | 125 TestExtraMemoryRanges(kCrashDebugBreak, |
126 FILE_PATH_LITERAL("..\\..\\out\\Release")); | 126 FILE_PATH_LITERAL("..\\..\\out\\Release")); |
127 #endif | 127 #endif |
128 } | 128 } |
129 #endif // ARCH_CPU_64_BITS | 129 #endif // ARCH_CPU_64_BITS |
130 | 130 |
131 } // namespace | 131 } // namespace |
132 } // namespace test | 132 } // namespace test |
133 } // namespace crashpad | 133 } // namespace crashpad |
OLD | NEW |