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

Unified Diff: src/platform-win32.cc

Issue 335008: Use RtlCaptureContext instead of inline assembly to capture execution context... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc (revision 3108)
+++ src/platform-win32.cc (working copy)
@@ -48,10 +48,10 @@
#ifndef NOMCX
#define NOMCX
#endif
-// Require Windows 2000 or higher (this is required for the IsDebuggerPresent
+// Require Windows XP or higher (this is required for the RtlCaptureContext
// function to be present).
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x500
+#define _WIN32_WINNT 0x501
#endif
#include <windows.h>
@@ -1183,22 +1183,7 @@
// Capture current context.
CONTEXT context;
- memset(&context, 0, sizeof(context));
- context.ContextFlags = CONTEXT_CONTROL;
- context.ContextFlags = CONTEXT_CONTROL;
-#ifdef _WIN64
- // TODO(X64): Implement context capture.
-#else
- __asm call x
- __asm x: pop eax
- __asm mov context.Eip, eax
- __asm mov context.Ebp, ebp
- __asm mov context.Esp, esp
- // NOTE: At some point, we could use RtlCaptureContext(&context) to
- // capture the context instead of inline assembler. However it is
- // only available on XP, Vista, Server 2003 and Server 2008 which
- // might not be sufficient.
-#endif
+ RtlCaptureContext(&context);
// Initialize the stack walking
STACKFRAME64 stack_frame;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698