Index: snapshot/win/crashpad_snapshot_test_image_reader.cc |
diff --git a/snapshot/win/crashpad_snapshot_test_crashing_child.cc b/snapshot/win/crashpad_snapshot_test_image_reader.cc |
similarity index 60% |
copy from snapshot/win/crashpad_snapshot_test_crashing_child.cc |
copy to snapshot/win/crashpad_snapshot_test_image_reader.cc |
index d74f6a62bddc3ac1e16aa0090a8adf4d95009fbd..9eb75f34b8a988e99f9a6a3974b06593df282cef 100644 |
--- a/snapshot/win/crashpad_snapshot_test_crashing_child.cc |
+++ b/snapshot/win/crashpad_snapshot_test_image_reader.cc |
@@ -12,32 +12,26 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include <stdint.h> |
-#include <stdlib.h> |
#include <windows.h> |
#include "base/logging.h" |
-#include "client/crashpad_client.h" |
#include "util/file/file_io.h" |
-#include "util/win/address_types.h" |
+#include "util/win/scoped_handle.h" |
-__declspec(noinline) crashpad::WinVMAddress CurrentAddress() { |
- return reinterpret_cast<crashpad::WinVMAddress>(_ReturnAddress()); |
-} |
- |
-int main(int argc, char* argv[]) { |
+int wmain(int argc, wchar_t* argv[]) { |
CHECK_EQ(argc, 2); |
- crashpad::CrashpadClient client; |
- CHECK(client.SetHandler(argv[1])); |
- CHECK(client.UseHandler()); |
+ crashpad::ScopedKernelHANDLE done(CreateEvent(nullptr, true, false, argv[1])); |
+ |
+ LoadLibrary(L"crashpad_snapshot_test_image_reader_module.dll"); |
Mark Mentovai
2015/09/19 19:20:27
Maybe this should be PCHECKed.
scottmg
2015/09/20 18:16:26
Done.
|
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); |
CHECK_NE(out, INVALID_HANDLE_VALUE); |
Mark Mentovai
2015/09/19 19:20:27
P on this CHECK too?
scottmg
2015/09/20 18:16:26
Done.
|
- crashpad::WinVMAddress break_address = CurrentAddress(); |
- crashpad::CheckedWriteFile(out, &break_address, sizeof(break_address)); |
+ char c = ' '; |
+ crashpad::CheckedWriteFile(out, &c, sizeof(c)); |
- __debugbreak(); |
+ CHECK_EQ(WAIT_OBJECT_0, WaitForSingleObject(done.get(), INFINITE)); |
return 0; |
} |
+ |