Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: snapshot/win/crashpad_snapshot_test_crashing_child.cc

Issue 1349313003: win: support x64 reading x86 (wow64) (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: mac Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/win/cpu_context_win.cc ('k') | snapshot/win/exception_snapshot_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/crashpad_snapshot_test_crashing_child.cc
diff --git a/handler/win/crashy_test_program.cc b/snapshot/win/crashpad_snapshot_test_crashing_child.cc
similarity index 50%
copy from handler/win/crashy_test_program.cc
copy to snapshot/win/crashpad_snapshot_test_crashing_child.cc
index 07c9cf101278213f36b55e3025b8b1c88ece15a4..d74f6a62bddc3ac1e16aa0090a8adf4d95009fbd 100644
--- a/handler/win/crashy_test_program.cc
+++ b/snapshot/win/crashpad_snapshot_test_crashing_child.cc
@@ -12,43 +12,32 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "client/crashpad_client.h"
+#include <stdint.h>
+#include <stdlib.h>
+#include <windows.h>
#include "base/logging.h"
-#include "tools/tool_support.h"
-
-namespace crashpad {
-namespace {
+#include "client/crashpad_client.h"
+#include "util/file/file_io.h"
+#include "util/win/address_types.h"
-void SomeCrashyFunction() {
- volatile int* foo = reinterpret_cast<volatile int*>(7);
- *foo = 42;
+__declspec(noinline) crashpad::WinVMAddress CurrentAddress() {
+ return reinterpret_cast<crashpad::WinVMAddress>(_ReturnAddress());
}
-int CrashyMain(int argc, char* argv[]) {
- if (argc != 2) {
- fprintf(stderr, "Usage: %s <server_pipe_name>\n", argv[0]);
- return 1;
- }
+int main(int argc, char* argv[]) {
+ CHECK_EQ(argc, 2);
- CrashpadClient client;
- if (!client.SetHandler(argv[1])) {
- LOG(ERROR) << "SetHandler";
- return 1;
- }
- if (!client.UseHandler()) {
- LOG(ERROR) << "UseHandler";
- return 1;
- }
+ crashpad::CrashpadClient client;
+ CHECK(client.SetHandler(argv[1]));
+ CHECK(client.UseHandler());
- SomeCrashyFunction();
+ HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
+ CHECK_NE(out, INVALID_HANDLE_VALUE);
+ crashpad::WinVMAddress break_address = CurrentAddress();
+ crashpad::CheckedWriteFile(out, &break_address, sizeof(break_address));
- return 0;
-}
-
-} // namespace
-} // namespace crashpad
+ __debugbreak();
-int wmain(int argc, wchar_t* argv[]) {
- return crashpad::ToolSupport::Wmain(argc, argv, crashpad::CrashyMain);
+ return 0;
}
« no previous file with comments | « snapshot/win/cpu_context_win.cc ('k') | snapshot/win/exception_snapshot_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698