X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fi386-windows-nat.c;h=3091fc362825aa2cac685301f99145f608952139;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=9c467fb60985801fc829100e64281874107d6a73;hpb=0b30217134add051e159a192066a1e568ebd837f;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/i386-windows-nat.c b/gdb/i386-windows-nat.c index 9c467fb609..3091fc3628 100644 --- a/gdb/i386-windows-nat.c +++ b/gdb/i386-windows-nat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2012 Free Software Foundation, Inc. +/* Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -17,12 +17,16 @@ #include "defs.h" #include "windows-nat.h" -#include "i386-nat.h" +#include "x86-nat.h" +#include "i386-tdep.h" #include -#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) -static const int mappings[] = +#ifdef __x86_64__ +#define CONTEXT WOW64_CONTEXT +#endif +#define context_offset(x) ((int)(size_t)&(((CONTEXT *)NULL)->x)) +const int i386_mappings[] = { context_offset (Eax), context_offset (Ecx), @@ -69,10 +73,21 @@ static const int mappings[] = context_offset (ExtendedRegisters[24]) }; #undef context_offset +#undef CONTEXT +/* segment_register_p_ftype implementation for x86. */ + +int +i386_windows_segment_register_p (int regnum) +{ + return regnum >= I386_CS_REGNUM && regnum <= I386_GS_REGNUM; +} + +void _initialize_i386_windows_nat (); void -_initialize_i386_windows_nat (void) +_initialize_i386_windows_nat () { - windows_set_context_register_offsets (mappings); - i386_set_debug_register_length (4); +#ifndef __x86_64__ + x86_set_debug_register_length (4); +#endif }