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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ~Delegate() override {} | 56 ~Delegate() override {} |
57 | 57 |
58 void set_break_near(void* break_near) { break_near_ = break_near; } | 58 void set_break_near(void* break_near) { break_near_ = break_near; } |
59 | 59 |
60 void ExceptionHandlerServerStarted() override { SetEvent(server_ready_); } | 60 void ExceptionHandlerServerStarted() override { SetEvent(server_ready_); } |
61 | 61 |
62 unsigned int ExceptionHandlerServerException( | 62 unsigned int ExceptionHandlerServerException( |
63 HANDLE process, | 63 HANDLE process, |
64 WinVMAddress exception_information_address) override { | 64 WinVMAddress exception_information_address) override { |
65 ProcessSnapshotWin snapshot; | 65 ProcessSnapshotWin snapshot; |
66 snapshot.Initialize(process); | 66 snapshot.Initialize(process, ProcessSuspensionState::kSuspended); |
67 snapshot.InitializeException(exception_information_address); | 67 snapshot.InitializeException(exception_information_address); |
68 | 68 |
69 // Confirm the exception record was read correctly. | 69 // Confirm the exception record was read correctly. |
70 EXPECT_NE(snapshot.Exception()->ThreadID(), 0u); | 70 EXPECT_NE(snapshot.Exception()->ThreadID(), 0u); |
71 EXPECT_EQ(snapshot.Exception()->Exception(), EXCEPTION_BREAKPOINT); | 71 EXPECT_EQ(snapshot.Exception()->Exception(), EXCEPTION_BREAKPOINT); |
72 | 72 |
73 // Verify the exception happened at the expected location with a bit of | 73 // Verify the exception happened at the expected location with a bit of |
74 // slop space to allow for reading the current PC before the exception | 74 // slop space to allow for reading the current PC before the exception |
75 // happens. See CrashingChildProcess::Run(). | 75 // happens. See CrashingChildProcess::Run(). |
76 const uint64_t kAllowedOffset = 64; | 76 const uint64_t kAllowedOffset = 64; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 handle->read.get(), &break_near_address, sizeof(break_near_address)); | 203 handle->read.get(), &break_near_address, sizeof(break_near_address)); |
204 delegate.set_break_near(break_near_address); | 204 delegate.set_break_near(break_near_address); |
205 | 205 |
206 // Wait for the child to crash and the exception information to be validated. | 206 // Wait for the child to crash and the exception information to be validated. |
207 WaitForSingleObject(completed.get(), INFINITE); | 207 WaitForSingleObject(completed.get(), INFINITE); |
208 } | 208 } |
209 | 209 |
210 } // namespace | 210 } // namespace |
211 } // namespace test | 211 } // namespace test |
212 } // namespace crashpad | 212 } // namespace crashpad |
OLD | NEW |