#ifdef __x86_64__
if (windows_process.wow64_process)
{
- th->wow64_context.ContextFlags = CONTEXT_DEBUGGER_DR;
+ th->wow64_context.ContextFlags = WOW64_CONTEXT_ALL;
CHECK (Wow64GetThreadContext (th->h, &th->wow64_context));
/* Copy dr values from that thread.
But only if there were not modified since last stop.
{
if (th->debug_registers_changed)
{
- th->wow64_context.ContextFlags |= CONTEXT_DEBUG_REGISTERS;
+ th->wow64_context.ContextFlags |= WOW64_CONTEXT_DEBUG_REGISTERS;
th->wow64_context.Dr0 = windows_process.dr[0];
th->wow64_context.Dr1 = windows_process.dr[1];
th->wow64_context.Dr2 = windows_process.dr[2];
/* Requesting the CONTEXT_EXTENDED_REGISTERS register set fails if
the system doesn't support extended registers. */
static DWORD extended_registers = CONTEXT_EXTENDED_REGISTERS;
+#ifdef __x86_64__
+ static DWORD wow64_extended_registers = WOW64_CONTEXT_EXTENDED_REGISTERS;
+#endif
again:
#ifdef __x86_64__
if (windows_process.wow64_process)
- th->wow64_context.ContextFlags = (CONTEXT_FULL
- | CONTEXT_FLOATING_POINT
- | CONTEXT_DEBUG_REGISTERS
- | extended_registers);
+ th->wow64_context.ContextFlags = (WOW64_CONTEXT_FULL
+ | WOW64_CONTEXT_FLOATING_POINT
+ | WOW64_CONTEXT_DEBUG_REGISTERS
+ | wow64_extended_registers);
else
#endif
th->context.ContextFlags = (CONTEXT_FULL
{
DWORD e = GetLastError ();
- if (extended_registers && e == ERROR_INVALID_PARAMETER)
+#ifdef __x86_64__
+ if (windows_process.wow64_process)
+ {
+ if (wow64_extended_registers && e == ERROR_INVALID_PARAMETER)
+ {
+ wow64_extended_registers = 0;
+ goto again;
+ }
+ }
+ else
+#endif
{
- extended_registers = 0;
- goto again;
+ if (extended_registers && e == ERROR_INVALID_PARAMETER)
+ {
+ extended_registers = 0;
+ goto again;
+ }
}
error ("GetThreadContext failure %ld\n", (long) e);